Get active cell row number vba
Solved
gnioler
Posted messages
83
Registration date
Status
Membre
Last intervention
-
gnioler Posted messages 83 Registration date Status Membre Last intervention -
gnioler Posted messages 83 Registration date Status Membre Last intervention -
Hello,
I would like to know
how I can retrieve the row number of the selected cell and then get the text in columns A, B, C, and D of that same row.
For example, if I am in H8, I want to retrieve the text from cells A8, B8, C8, and D8 and write all this text in cell H8.
Configuration: Windows 7 / Internet Explorer 7.0
I would like to know
how I can retrieve the row number of the selected cell and then get the text in columns A, B, C, and D of that same row.
For example, if I am in H8, I want to retrieve the text from cells A8, B8, C8, and D8 and write all this text in cell H8.
Configuration: Windows 7 / Internet Explorer 7.0
4 réponses
Hello and thank you for your response.
However, I use this macro to create a hyperlink in cell H8.
Here is my macro:
ActiveCell.Offset(rowOffset:=0, columnOffset:=1).Activate
Dim Ligne As Long
Dim Chaine As String
Ligne = ActiveCell.Row
Chaine = ActiveCell.Offset(0, -8).Value & " "
Chaine = Chaine & ActiveCell.Offset(0, -7).Value & " "
Chaine = Chaine & ActiveCell.Offset(0, -6).Value & " "
Chaine = Chaine & ActiveCell.Offset(0, -5).Value & " "
Chaine = Chaine & ActiveCell.Offset(0, -4).Value & " "
Chaine = Chaine & ActiveCell.Offset(0, -3).Value
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="S:\DEVIS\A CLASSER\" & [Chaine] & ".xlsm" & Lien
ActiveCell.Offset(rowOffset:=0, columnOffset:=-1).Activate
The problem is that when I click on the link, it does open the Excel sheet that was saved previously, but it can no longer find links with other files, whereas if I open it without the hyperlink, it works.
Does the link remove these connections, or is there a line of code to add?
Thank you in advance for your responses.
However, I use this macro to create a hyperlink in cell H8.
Here is my macro:
ActiveCell.Offset(rowOffset:=0, columnOffset:=1).Activate
Dim Ligne As Long
Dim Chaine As String
Ligne = ActiveCell.Row
Chaine = ActiveCell.Offset(0, -8).Value & " "
Chaine = Chaine & ActiveCell.Offset(0, -7).Value & " "
Chaine = Chaine & ActiveCell.Offset(0, -6).Value & " "
Chaine = Chaine & ActiveCell.Offset(0, -5).Value & " "
Chaine = Chaine & ActiveCell.Offset(0, -4).Value & " "
Chaine = Chaine & ActiveCell.Offset(0, -3).Value
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="S:\DEVIS\A CLASSER\" & [Chaine] & ".xlsm" & Lien
ActiveCell.Offset(rowOffset:=0, columnOffset:=-1).Activate
The problem is that when I click on the link, it does open the Excel sheet that was saved previously, but it can no longer find links with other files, whereas if I open it without the hyperlink, it works.
Does the link remove these connections, or is there a line of code to add?
Thank you in advance for your responses.