Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Name Macro
Hi,
I have a column that has the first and last name separated by a space in that column. Is there a way to write a macro to place the last name in a different column? Thanks!! -Matt |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Name Macro
data=Text to columns
-- Regards, Tom Ogilvy "Matt" wrote in message ... Hi, I have a column that has the first and last name separated by a space in that column. Is there a way to write a macro to place the last name in a different column? Thanks!! -Matt |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Name Macro
You don't need a macro
=MID(A1,FIND(" ",A1)+1,99) in B1 will get the surname, and copy down. If you must have a macro For Each cell In Selection cell.Offset(0,1).Value = mid(Range("A1"),Instr(Range("A1")," ")+1, _ len(Range("A1"))-Instr(Range("A1")," ")) Next cell -- HTH RP (remove nothere from the email address if mailing direct) "Matt" wrote in message ... Hi, I have a column that has the first and last name separated by a space in that column. Is there a way to write a macro to place the last name in a different column? Thanks!! -Matt |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Name Macro
Thanks, that did the trick!!
"Bob Phillips" wrote: You don't need a macro =MID(A1,FIND(" ",A1)+1,99) in B1 will get the surname, and copy down. If you must have a macro For Each cell In Selection cell.Offset(0,1).Value = mid(Range("A1"),Instr(Range("A1")," ")+1, _ len(Range("A1"))-Instr(Range("A1")," ")) Next cell -- HTH RP (remove nothere from the email address if mailing direct) "Matt" wrote in message ... Hi, I have a column that has the first and last name separated by a space in that column. Is there a way to write a macro to place the last name in a different column? Thanks!! -Matt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |