Hi All,
Hope you can help i have the following code which when you click a customer's number in column A, starting with row 3, will link to another sheet within the same workbook to show just their details from their row. There are 35 columns in total. The code works, however, the whole sheet appears to be hyperlinked, although column A is the only one one in blue and underlined. The rest of the text from column B to AI shouldn't be linked.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim NUM As String
Dim CustomerList As Integer, CustomerCount As Integer, CustomerDataCheck As Integer
Dim lastRow As Long
CustomerList = 3
CustomerCount = Sheet3.Range("A515").Value
For CustomerDataCheck = CustomerList To CustomerCount + 10
With Me
.Cells(CustomerList, 1).Hyperlinks.Add Anchor:=Cells(CustomerList, 1), Address:="", SubAddress:=Cells(CustomerList, 1).Address, ScreenTip:="Click here to view customer summary.", TextToDisplay:=Cells(CustomerList, 1).Value
.Select
End With
CustomerList = 3 + 1
Next CustomerDataCheck
NUM = Selection.Value
If NUM <> vbNullString Then
Sheet2.Range("Z8").Value = NUM
Sheet2.Range("T6").Value = Sheet2.Range("Z9").Value
Sheet2.Activate
Sheet2.Range("D2").Select
End If
End Sub
Thank you for your help in advance.
Hope you can help i have the following code which when you click a customer's number in column A, starting with row 3, will link to another sheet within the same workbook to show just their details from their row. There are 35 columns in total. The code works, however, the whole sheet appears to be hyperlinked, although column A is the only one one in blue and underlined. The rest of the text from column B to AI shouldn't be linked.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim NUM As String
Dim CustomerList As Integer, CustomerCount As Integer, CustomerDataCheck As Integer
Dim lastRow As Long
CustomerList = 3
CustomerCount = Sheet3.Range("A515").Value
For CustomerDataCheck = CustomerList To CustomerCount + 10
With Me
.Cells(CustomerList, 1).Hyperlinks.Add Anchor:=Cells(CustomerList, 1), Address:="", SubAddress:=Cells(CustomerList, 1).Address, ScreenTip:="Click here to view customer summary.", TextToDisplay:=Cells(CustomerList, 1).Value
.Select
End With
CustomerList = 3 + 1
Next CustomerDataCheck
NUM = Selection.Value
If NUM <> vbNullString Then
Sheet2.Range("Z8").Value = NUM
Sheet2.Range("T6").Value = Sheet2.Range("Z9").Value
Sheet2.Activate
Sheet2.Range("D2").Select
End If
End Sub
Thank you for your help in advance.