Hi: I need help with writing a new macro and integrating it into some existing code. My existing code works well for creating an auto hyperlink, from one sheet to another, triggerered by a dropdown value in Sh1 column K.
I'm trying to add vba code to have the same trigger do a copy of cells in column A and B from Sh1 and paste to Sh2. The info from these 2 cells will go into Sh2 A and B on the same row as the hyperlink points to (which is the next available open Cell in column A).
Sh1 is named MAD_CAT
Sh2 is named CABLE_MATRIX
Here is my tested hyperlink code :
I'm trying to add vba code to have the same trigger do a copy of cells in column A and B from Sh1 and paste to Sh2. The info from these 2 cells will go into Sh2 A and B on the same row as the hyperlink points to (which is the next available open Cell in column A).
Sh1 is named MAD_CAT
Sh2 is named CABLE_MATRIX
Here is my tested hyperlink code :
HTML:
'This is option A to add hyperlink automatically. When "Cable Assy..." in column k dropdownn is selected then
'a hyperlink is automatically created which links to the next blank cell A on the Cable Matrix Worksheet.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rws As Long, sh As Worksheet
Set sh = Worksheets("CABLE_MATRIX")
With sh
Rws = .Cells(Rows.Count, "A").End(xlUp).Row + 1
End With
If Target.Count = 1 And Target.Column = 11 Then
If InStr(Target, "Cable Assy") <> 0 Then
ActiveSheet.Hyperlinks.Add Anchor:=Target.Offset(0, 5), Address:="", SubAddress:= _
"CABLE_MATRIX!A" & Rws, TextToDisplay:="CABLE_MATRIX!A" & Rws
End If
End If