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?
Selection.NumberFormat = "@"
For Each c In Selection
c.Value = Replace(c, ".", ",")
Next
9 Replies
Sort By
- VShostakCopper ContributorNow they change "." on space " " instead ",".
Сan you tell me how to write the code correctly.Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?