ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Moving blocks of data across worksheets (https://www.excelbanter.com/excel-programming/398514-moving-blocks-data-across-worksheets.html)

[email protected]

Moving blocks of data across worksheets
 
Hi All,

Can you help? I have a excel workbook with 100tabs, I need to collect
data from all to put into a single sheet, the data is in a floating
range, it always starts at the same point, is the same width, but can
be hundereds of lines.......

All sets have a different name, in a specific cell... i need to copy
this and replicate down for each line????

I hope that makes enough sense....

Thanks in advance

Craig


Tom Ogilvy

Moving blocks of data across worksheets
 
assuming the data is isolated in that there are no filled cells adjacent to
it that you do not want to copy.

Assume it always starts in b9 and there are no blank rows or columns within
the data range

Sub copyData()
Dim sh as worksheet, sh1 as Worksheet
dim rng as Range, r1 as Range
set sh = worksheets("Summary") '<== change as needed
for each sh1 in worksheets
if sh1.Name < sh.Name then
set rng = sh1.Range("B9").Currentregion
set r1 = sh.cells(rows.count,1).End(xlup)(2)
rng.Copy r1
end if
next
End sub

--
regards,
Tom Ogilvy

" wrote:

Hi All,

Can you help? I have a excel workbook with 100tabs, I need to collect
data from all to put into a single sheet, the data is in a floating
range, it always starts at the same point, is the same width, but can
be hundereds of lines.......

All sets have a different name, in a specific cell... i need to copy
this and replicate down for each line????

I hope that makes enough sense....

Thanks in advance

Craig




All times are GMT +1. The time now is 07:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com