Link to home
Start Free TrialLog in
Avatar of E=mc2
E=mc2Flag for Canada

asked on

Excel Macro to delete specific characters

I need an excel Macro to delete specific characters, namely " and ,
When it finds any quotes or commas it needs to delete these.
Avatar of Jacques Geday
Jacques Geday
Flag of Canada image

What is the extent of the data can you post a sample workbook ?
gowflow
Avatar of E=mc2

ASKER

Column A and Column B only, approximately 6000 lines.
try this code

Sub DelChar()
Dim WS As Worksheet
Dim cCell As Range
Dim sTemp As String

Set WS = ActiveSheet
For Each cCell In WS.UsedRange.SpecialCells(xlCellTypeConstants)
    sTemp = cCell.Value
    sTemp = Replace(sTemp, ",", "")
    sTemp = Replace(sTemp, """", "")
    cCell.Value = sTemp
Next cCell
End Sub

Open in new window


gowflow
Avatar of E=mc2

ASKER

Thanks. For some reason this is affecting the data in Column A in a manner that it is not desired.
What if I only wanted to apply these commands to Column B only??
ASKER CERTIFIED SOLUTION
Avatar of Jacques Geday
Jacques Geday
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial