Excel VBA: Loop through list to copy batches of like values

angoodkind

New Member
Joined
Jan 8, 2010
Messages
10
Thank you in advance for all of your help <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
I'm trying to copy batches of rows, based upon one column's values. <o:p></o:p>
<o:p></o:p>
The worksheet looks like this (sorted by the first column):<o:p></o:p>
<o:p></o:p>
A 5 blue<o:p></o:p>
A 6 yellow<o:p></o:p>
B 3 red<o:p></o:p>
B 2 blue <o:p></o:p>
<o:p></o:p>
The loop has 3 primary steps:<o:p></o:p>
1) Copy all rows beginning with a value, e.g. rows 1-2, which both begin with "A" <o:p></o:p>
2) Paste rows into an email (I know how to do this) <o:p></o:p>
3) Move to the value, B, and copy all rows starting with B <o:p></o:p>
<o:p></o:p>
I won't know the values of Column A, as they will change each time. Is there a way I can still write this loop?<o:p></o:p>
<o:p></o:p>
Thanks,
Adam<o:p></o:p>
<o:p></o:p>
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top