hi Folks
I have a customer who imports a text file from a JD Edwards system and it comes in with many many commas e.g.
item,,,,,,,,,widget,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,thing,,,,,,,,,,,,,,,,,,,,,,,
(of course the number of commas is not consistent....:-)
Any suggestions on how she could clean up the file...thanks. :-)
With Selection Set c = .Find(",,", LookIn:=xlValues) If Not c Is Nothing Then Do c.Replace What:=",,", Replacement:=",", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Set c = .FindNext(c) Loop While Not c Is Nothing End IfEnd With
This option worked for me - the Text to columns option when I tried it again and put the excess delimiter in the Other box. Great stuff.
Microsoft Excel
Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.
Open in new window
Regards