Hi
In A1 to A5, there is a cell with a substring that I want to replace. I tried the below code but it doesn't work
Note that in A1 to A5, there are some empty cells or with text.
Thank you.
Sub test ()
Dim p as range
For Each p In Activesheet.Range("A1:A5")
p.Value = Replace(p.Value, "yyyy-yyyy", "St_Yr - End_Yr")
Next
End Sub
In A1 to A5, there is a cell with a substring that I want to replace. I tried the below code but it doesn't work
Note that in A1 to A5, there are some empty cells or with text.
Thank you.
Sub test ()
Dim p as range
For Each p In Activesheet.Range("A1:A5")
p.Value = Replace(p.Value, "yyyy-yyyy", "St_Yr - End_Yr")
Next
End Sub