macro to move part of cell contents to another cell

I

icetoad hisself

I've been trying to program a macro to search for all text after a colon :))
and move that text to an adjacent empty cell. I've been able to get it to
search, but from that point on it will only paste what is already on the
clipboard instead of copying new text.

What am I missing? Or is it evenpossible?
 
D

Don Guillett

Sure, As always, post YOUR code for comments. You should also provide
details of what you are trying to do.
 
P

Paul Morgan

Sub Macro1()
Application.DisplayAlerts = False
Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited,
_
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=True, Comma:=False, Space:=False, Other:=True,
OtherChar:= _
":", FieldInfo:=Array(Array(1, 1), Array(2, 1))
End Sub

When using macro recorder un text to columns, especially if you are
using : as a delimiter
 
L

LenB

Hi.
You can do it without a macro. If your text (containing a colon) is in
A2, put =RIGHT(A2,LEN(A2)-FIND(":",A2)) in B2 to get the text after the
colon. If there are cells without a colon, you get a #value error, so
if necessary wrap it in an if statement like this
=IF(ISERROR(FIND(":",A2)),"",RIGHT(A2,LEN(A2)-FIND(":",A2)))
That will return a blank if there is no colon in A2.

Len
 
D

Dorak

You could add a new column to the right of your column, choose the column you
want to separate, and choose Data/Text to Columns and choose "Other" as a
delimiter and insert a colon there. Done!
 
Top