copy large sheet to master sheet

KeythStone

New Member
Joined
Mar 30, 2011
Messages
36
Hello all,

I am trying to write vba script to automate copy of worksheets to a master sheet and I've seen all sorts of examples out there as well as a few internally at work. But my issue exceeds the limits placed on them and I was hoping it wasn't a universal constraint that I'm running into.

Issue: The sheets to copy are quite large averaging 11000 rows. the data to copy is dynamic meaning the volume changes, so finding the lastusedrow or something like that is needed. Most codes i've found, though, are limited to range("A65536"). I'm using 2007 which allows for more row count.

Goal: To get multiple sheets to a master sheet, ultimately to be imported into access.

Any help would be great.

Stay Smooth!!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Will the last row of data always contain a value in Column A? If so, just determine the last row of col A using:

Code:
Dim   LastRowNumber As Long
With Sheets(x)  'where x is the string name or index of sheet of interest
  LastRowNumber = .Cells(.Rows.Count,"A").End(xlUp).Row
  .Range("A2:G" &   LastRowNumber).Copy
  'more code...
End With
 
Upvote 0
Thanks,

I'm trying that right now. My biggest issue with this process is pasting the selection succinctly, meaning sheet1 (11000 rows) paste in master, then sheet2 (11000 rows) paste just below the @ (row 11001).

Thanks,
Smooth
 
Upvote 0
You can use the same process to find the last row on the master sheet and then start the paste immediately below:

Code:
Range("A1:G1000").Copy

With Sheets("Master")
  'identify last row with data and paste into next cell down:
  .Cells(.Rows.Count,"A").End(xlUp).Offset(1,0).PasteSpecial
End With
 
Upvote 0

Forum statistics

Threads
1,224,596
Messages
6,179,807
Members
452,944
Latest member
2558216095

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