Replacing point with comma using VBA
boggg
-
Carlguer -
Carlguer -
Hello,
For those who know VBA Excel,
I created a very simple macro that selects a sheet and replaces periods with commas,
when we do it "manually" (Edit/Replace, etc.), it works perfectly.
However, with the macro, which indeed describes the action mentioned above, it doesn't work.
For example, for numbers like: 1.27365e+006
the macro transforms them into: 127365000000
Here is the macro, it is very simple:
Sub pv3()
Cells.Select
Application.CutCopyMode = False
Selection.NumberFormat = "General"
Selection.Replace What:=".", Replacement:=",", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End Sub
Thank you in advance for your response
For those who know VBA Excel,
I created a very simple macro that selects a sheet and replaces periods with commas,
when we do it "manually" (Edit/Replace, etc.), it works perfectly.
However, with the macro, which indeed describes the action mentioned above, it doesn't work.
For example, for numbers like: 1.27365e+006
the macro transforms them into: 127365000000
Here is the macro, it is very simple:
Sub pv3()
Cells.Select
Application.CutCopyMode = False
Selection.NumberFormat = "General"
Selection.Replace What:=".", Replacement:=",", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End Sub
Thank you in advance for your response
Configuration: Windows XP Internet Explorer 6.0