J
JackGombola
I have an Excel 2003 spreadsheet with only one column of player data: column
A. The first three data items in column A are the same for every player:
Name, Address and Phone. Every player also has at least one comment but
could have any number of comments. Each player’s data is separated from the
next by a blank cell in column A. Sometimes, a player’s last few comments are
blank resulting in multiple blank cells in column A before the data for the
next player starts.
I need help writing an Excel 2003 VBA macro to:
1. Copy just the player’s name, but not the Name: label, to column B as shown.
2. Copy just the address, but not the Address: label, to column C
3. Copy just the phone, but not the Phone: label, to D
4. Combine all of the player’s comments, but not the original Comment:
label, into one paragraph and paste into E. Repeat the above process,
ignoring any blank rows separating the players, for all the player data in
column A.
A B C D E
Name:John John Main St 555-1212 Plays 1st base. Plays
2nd
Address:Main St Jane Center St 555-1213 Catches well. Has played
center.
Phone:555-1212
Commentlays 1st base
Plays 2nd
Name:Jane
Address:Center St
Phone:555-1213
Comment:Catches well
Has played center.
I've been able to do the easy stuff, repositioning the column headings etc.
but the variable number of comments entries is giving me trouble as is
removing the labels and colons) that precede the data. I'm guessing that
the latter is done with a find to find the colon) but then how do I copy
all the characters to the right?
Thanks is advance for any ideas.
Jack
A. The first three data items in column A are the same for every player:
Name, Address and Phone. Every player also has at least one comment but
could have any number of comments. Each player’s data is separated from the
next by a blank cell in column A. Sometimes, a player’s last few comments are
blank resulting in multiple blank cells in column A before the data for the
next player starts.
I need help writing an Excel 2003 VBA macro to:
1. Copy just the player’s name, but not the Name: label, to column B as shown.
2. Copy just the address, but not the Address: label, to column C
3. Copy just the phone, but not the Phone: label, to D
4. Combine all of the player’s comments, but not the original Comment:
label, into one paragraph and paste into E. Repeat the above process,
ignoring any blank rows separating the players, for all the player data in
column A.
A B C D E
Name:John John Main St 555-1212 Plays 1st base. Plays
2nd
Address:Main St Jane Center St 555-1213 Catches well. Has played
center.
Phone:555-1212
Commentlays 1st base
Plays 2nd
Name:Jane
Address:Center St
Phone:555-1213
Comment:Catches well
Has played center.
I've been able to do the easy stuff, repositioning the column headings etc.
but the variable number of comments entries is giving me trouble as is
removing the labels and colons) that precede the data. I'm guessing that
the latter is done with a find to find the colon) but then how do I copy
all the characters to the right?
Thanks is advance for any ideas.
Jack