ExcelJunior
New Member
- Joined
- Nov 23, 2011
- Messages
- 18
I would like to know if it is possible to complete a "Find and Replace" but replace with a formula as opposed to a value?
Sub Macro1()
Dim myRng As Range
Dim c As Range
Dim cCount As Long
Dim i As Long
cCount = ActiveSheet.UsedRange.Rows.Count
Set myRng = ActiveSheet.Range("H1:I" & cCount)
For Each c In myRng
If c.Value <> "" Then
c.Hyperlinks.Add anchor:=c, Address:="http://shop.domain.com/part/" & c.Value, ScreenTip:=c.Value
End If
Next c
End Sub
Sub Macro4()
Dim myRng As Range
Dim c As Range
Dim cCount As Long
Dim myArr As Variant
myArr = Array("H", "I", "L", "M")
Dim i As Long
cCount = ActiveSheet.UsedRange.Rows.Count + 1
For Each arr In myArr
Set myRng = ActiveSheet.Range(arr & "1:" & arr & cCount)
For Each c In myRng
If c.Value <> "" Then
c.Hyperlinks.Add Cells(c.Row, c.Column), "http://www.domain.com/part/" & c.Text, c.Text
End If
Next c
Next arr
End Sub