find and remove a string of a cell value with comma as delimiter

  • Thread starter Thread starter yefei
  • Start date Start date
Y

yefei

can anyone help me on this?
i have columns of data which has the format of (something1,something2,
something3, others)
the string "somthing1", "somthing2", "somthing3" are consistent, and
not all may appear at the same time, while the part "others" may vary.
I want to extract the "others" part, if the cell has
how can i do this in a macro?
i donot want to modify the original cell, but will store the "others"
in another sheet
 
If you goto
the top file menu
data=>text to columns
then select what you want, this will do exactly what you are asking
Dave
 
thanks any way
i want to do it in macro, not manually
that is whenever i want to perform the task, just call the macro
all will be done
 
I just recorded this Macro and seems to work fine,
I highlited the range I wanted changed and clicked on the macro, and
voila,
they say the macro recorder will be a big thing someday!!!


Sub Macro1()
'
' Macro1 Macro
' Macro recorded 2/28/2006 by Dave
'

'
Selection.TextToColumns Destination:=ActiveCell,
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False,
FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1),
Array(5, 1))
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top