Macro Copy and Paste Help - Macro and VBA Newbie

G

gatorcc

I have a report that is generated daily. Each row of the report can be
divided into 15 separate items with each item having 6 sub items. All of
this is on one row.

For example on my sheet labled "data" cell C2 = item 1a, D2 = item 1b, E2 =
item 1c, F2 = item 1d, G2 = item 1e, and H2 = item 1f all the way to CN2 =
item 15g.

On my "Report" Sheet cell c2 from the Data sheet needs to be pasted in cell
C8 of Report Sheet , cell D2 from the Data sheet needs to be pasted in cell
D8 of Report Sheet, Data E2 = Report E8, Data F2 = Report F8, Data G2 =
Report G8, and Data H2 = Report H8.

Then if there is some data in Data sheet I2 place that on Reports page C9
and so on until an empty column is hit or Data Cell CN2 is hit. Once an
empty cell or CN2 is reached then the macro would start over on Data cell C3
and continue. This would continue until the end of the data is reached.

There is a catch on the Report sheet it is segmented every 25 rows. So Rows
8-32, Rows 38-62 ...etc.

I know I was long winded but I have absolutely no idea how to do this other
than doing it manually and I don't want to do that. In a perfect world there
would be a button I press on the Reports sheet and it does it for me!

Any help would be greatly appreciated.
 
R

Ronald R. Dodge, Jr.

You can use the Copy method as:

<SourceRangeObject>.Copy <DestinationRangeObject>

Just be sure to prequalify your ranges to avoid ambiguity, which my
suggestion is to go all the way back to the workbook object or use a range
object variable that has been set to the proper range with the prequalified
objects at the time of being set.

--
Thanks,

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top