View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Melanie Melanie is offline
external usenet poster
 
Posts: 78
Default Moving text from a line to a new line based on a condition

I've been trying to do this with a macro but I think VB is needed and I'm
"not" a VB developer so I really hope one of you can help me out. This is the
last major thing I need to make this thing work.

I have records with columns Group, FName, LName, and Combined.
If there are more than 30 characters in the Combined field, I need to move
the full names to the next line, remove the "^" at the end or beginning of
the line (depending on what was moved) and copy the other fields in the
original line. Uploading the list otherwise makes the program bomb for some
reason. I hope someone out there can help me.

group name combined
marketing mjagger mjagger^rthomas^xbono
marketing rthomas mjagger^rthomas^xbono
marketing xbono mjagger^rthomas^xbono
accounting rcharles rcharles^jbrown
accounting jbrown rcharles^jbrown
hr jmayer jmayer
it jjohnson
jjohnson^bdylan^joplin^jfoggerty^braitt
it bdylan
jjohnson^bdylan^joplin^jfoggerty^braitt
it jjoplin
jjohnson^bdylan^joplin^jfoggerty^braitt
it jfoggerty
jjohnson^bdylan^joplin^jfoggerty^braitt
it braitt
jjohnson^bdylan^joplin^jfoggerty^braitt

The example above would become:

group name combined
marketing mjagger mjagger^rthomas^xbono
marketing rthomas mjagger^rthomas^xbono
marketing xbono mjagger^rthomas^xbono
accounting rcharles rcharles^jbrown
accounting jbrown rcharles^jbrown
hr jmayer jmayer
it jjohnson jjohnson^bdylan^joplin
it jjohnson jfoggerty^braitt
it bdylan jjohnson^bdylan^joplin
it bdylan jfoggerty^braitt
it jjoplin jjohnson^bdylan^joplin
it jjoplin jfoggerty^braitt
it jfoggerty jjohnson^bdylan^joplin
it jfoggerty jfoggerty^braitt
it braitt jjohnson^bdylan^joplin
it braitt jfoggerty^braitt