gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,341
- Office Version
- 365
- Platform
- Windows
I have the below code that works perfectly. It names the range.
But now I need to modify this code so that it changes the range instead of just changing C37. Thank you and I appreciate the help!
Code:
Sub Path_NameRange()
'On table "Search_Results" find the range for Path/Location and name it
'In the code, it is looking to see where the title Path/Location is and then starting the range from there (+1) down.
Dim fnd As Range
Set fnd = Sheet2.Range("Y:Y").Find("Path/Location", LookIn:=xlValues, lookat:=xlWhole)
Sheet2.Range("Y" & fnd.Row + 1, Range("Y" & Rows.Count).End(xlUp)).Name = "Path"
End Sub
But now I need to modify this code so that it changes the range instead of just changing C37. Thank you and I appreciate the help!
Code:
Sub ConvertToHyper()
Dim xlRange As Range
Set xlRange = Range("C37")
For Each Rng In xlRange
ActiveSheet.Hyperlinks.Add Rng, Rng.Value
Next
End Sub