albytross
New Member
- Joined
- Sep 22, 2021
- Messages
- 24
- Office Version
- 365
Hi all,
I have the following VBA code - I want to clear any commas from the entire workbook, and all worksheets.
I plan to export all worksheets as CSV's, so errant commas can cause problems.
The below code seems to only clear commas from some sheets and I can't fix it.
I'm using xlPart to remove commas from within cells
I have the following VBA code - I want to clear any commas from the entire workbook, and all worksheets.
I plan to export all worksheets as CSV's, so errant commas can cause problems.
The below code seems to only clear commas from some sheets and I can't fix it.
I'm using xlPart to remove commas from within cells
Sub RemoveCommas()
Dim ws As Worksheet
Dim Search As String
Dim Replacement As String
Dim Prompt As String
Dim Title As String
Dim MatchCase As Boolean
For Each ws In Worksheets
ws.Cells.Replace what:=",", Replacement:="", _
LookAt:=xlPart, MatchCase:=False
Next
End Sub