hello~
I get question of Hyperlinks.
there are ref no. in sheet 1 and sheet 2. I create Hyperlink in sheet1, when click one of ref no. in sheet 1,it will get the cell value then link to sheet 2 .cell in the same value.
For example, user click ref no. A00001 sheet1, then link A00001 in sheet2. Its successful to create hyperlink, but when click the link, system shows error' Reference isn't valid'. I have checked the subaddress get value as image. please give advice ? : )
Dim x As Integer
Dim LastRow As Integer
Dim sName As String
LastRow = Cells(Rows.Count, "a").End(xlUp).Row
sName = "Sheet2"
MsgBox LastRow
With ActiveWorkbook.Worksheets("Sheet1")
For x = 1 To LastRow
Cells(x, "a").Activate
.Hyperlinks.Add Anchor:=ActiveCell, Address:="", SubAddress:=" & Sheet2 & " & ActiveCell.Text, TextToDisplay:=ActiveCell.Text
Next x
End With
I get question of Hyperlinks.
there are ref no. in sheet 1 and sheet 2. I create Hyperlink in sheet1, when click one of ref no. in sheet 1,it will get the cell value then link to sheet 2 .cell in the same value.
For example, user click ref no. A00001 sheet1, then link A00001 in sheet2. Its successful to create hyperlink, but when click the link, system shows error' Reference isn't valid'. I have checked the subaddress get value as image. please give advice ? : )
Dim x As Integer
Dim LastRow As Integer
Dim sName As String
LastRow = Cells(Rows.Count, "a").End(xlUp).Row
sName = "Sheet2"
MsgBox LastRow
With ActiveWorkbook.Worksheets("Sheet1")
For x = 1 To LastRow
Cells(x, "a").Activate
.Hyperlinks.Add Anchor:=ActiveCell, Address:="", SubAddress:=" & Sheet2 & " & ActiveCell.Text, TextToDisplay:=ActiveCell.Text
Next x
End With