Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing commas
I have this string:
,,,,,206,,,,210,,,,,,217,,,,,222,,,,,,,229,,,233,, ,,, I would like to output this string: 206,210,217,222,229,233, How can this be done in VBA? Reviewing the group, it seems like this snip of code could get me close, but I am unclear on how to adapt it to my purpose. ----- Function stripped$(s$) Const ok = "[#A-z]" '<remove the space here Dim i%, t$, r$ For i = 1 To Len(s) t = Mid(s, i, 1) r = r & iif(t Like ok,t," ") Next 'optional remove double spaces 'it has to be the worksheetfunction 'vba trim just trims on the outside r=application.worksheetfunction.trim(r) stripped = r End Function off the cuff.. hope it works :) keepITcool ------------- Thanks, Ray |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
removing commas from numbers etc. | Excel Worksheet Functions | |||
Removing patterns without removing gridlines | Excel Discussion (Misc queries) | |||
So many commas | Excel Worksheet Functions | |||
tab delimited and commas | Excel Discussion (Misc queries) | |||
Removing commas | Excel Worksheet Functions |