Hello,
I'm trying to write VBA code in for specific columns to replace "." with ","
But I receive an error "Subscript out of Range". Could you please help??
Sub FindReplaceAll()
Dim sht As Worksheet
Dim rng As Range
Dim fnd As Variant
Dim rplc As Variant
fnd = "."
rplc = ","
Set sht = Sheets("Sheet1")
Set rng = sht.Range("I2:I50")
rng.Replace what:=fnd, Replacement:=rplc, _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
End Sub
I'm trying to write VBA code in for specific columns to replace "." with ","
But I receive an error "Subscript out of Range". Could you please help??
Sub FindReplaceAll()
Dim sht As Worksheet
Dim rng As Range
Dim fnd As Variant
Dim rplc As Variant
fnd = "."
rplc = ","
Set sht = Sheets("Sheet1")
Set rng = sht.Range("I2:I50")
rng.Replace what:=fnd, Replacement:=rplc, _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
End Sub