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
HansVogelaar
Nov 06, 2023MVP
The values in columns Z to AC have spaces before the numbers. Why is that?
- VShostakNov 06, 2023Copper ContributorBecause this data is inserted from another file. Then I wanted the button to change "." on ","
- HansVogelaarNov 06, 2023MVP
Try this:
Sub change() Selection.Replace What:=".", Replacement:=",", LookAt:=xlPart Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart End Sub- VShostakNov 07, 2023Copper ContributorThe same thing