Hello all,
Im struggling with this one. Im tring to add a hyperlink the a cell within a with statement.
Heres what im trying to do. I have textbox in a userform that has a number in it. The number is used to search a workbook for a matching number. The macro then finds the row the cell is in. I then want to place a hyperlink in cell column "AE" of the same row that was found.
Linked below is my attempt at the code, not sure what im missing or doing wrong.
Any help is greatly appreciated.
Im struggling with this one. Im tring to add a hyperlink the a cell within a with statement.
Heres what im trying to do. I have textbox in a userform that has a number in it. The number is used to search a workbook for a matching number. The macro then finds the row the cell is in. I then want to place a hyperlink in cell column "AE" of the same row that was found.
Linked below is my attempt at the code, not sure what im missing or doing wrong.
Any help is greatly appreciated.
VBA Code:
Dim Fd1 As FileDialog
Set Fd1 = Application.FileDialog(msoFileDialogFolderPicker)
With Fd1
.AllowMultiSelect = False
.Title = "Please Select Customers RGA Folder"
If .Show = True Then
strPath2 = .SelectedItems(1) & "\"
MkDir (strPath2 & "RGA " & TextBox1.Value & "\")
strPath3 = strPath2 & "RGA " & TextBox1.Value & "\"
Else
GoTo skip1:
End If
End With
For Each ws2 In wb1.Worksheets
Set FoundCell = ws2.Columns(1).Find(What:=UserSearch, LookIn:=xlValues, LookAt:=xlWhole)
If Not FoundCell Is Nothing Then
Application.Goto FoundCell, True
Hyperlinks.Add anchor:=Range("AE" & ActiveCell.Row).Value, _
Address:=strPath3, TextToDisplay:=strPath3
End If
Next ws2