Forum Discussion
VShostak
Nov 06, 2023Copper Contributor
macro VBA excel change cell format
Hello! In my macro, I used code to replace "." on ",". However, during this replacement, the cell format changes to text. How can I write code to ensure that the format remains as a number? S...
VShostak
Nov 06, 2023Copper Contributor
Because this data is inserted from another file. Then I wanted the button to change "." on ","
HansVogelaar
Nov 06, 2023MVP
Try this:
Sub change()
Selection.Replace What:=".", Replacement:=",", LookAt:=xlPart
Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart
End Sub