Sorry for a wordy title. I have wrote code below creating a hyperlink on the x's under # column, and when clicked arrives at the latest nonempty cell under the 2 PQ Columns (first x - > 'good' under 'Blah PQ19' column, 4th x -> 1 under 'Blah PQ18' column.)
I need to replace/rename the x's with either PQ18 or PQ19 (under where the hyperlink arrives to). Does anyone know how to do this? If my explanation is unclear, please let me know. Thank you.
Code:
Dim i As Integer
Dim PCell As String
For i = 2 To 5
If Not IsEmpty(Cells(i, "CT").End(xlToRight)) Then
PCell = Cells(i, "CT").End(xlToRight).Address
ActiveSheet.Hyperlinks.Add Cells(i, 2), Address:="", SubAddress:="'" & Sheet1.Name & "'!" & PCell
End If
Next i