Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Macro to Copy/Paste Data into one wksht, skipp one row before past

Hi,

I'm working w/about 100 tabs that contain data. I have a macro that will
copy and paste the data and have tested it on three tabs (recorded macro). I
also have a macro to delete empty rows between data. I could continue to
record the macro for all of the tabs, but as you can imagine, that may take a
while.

The range of the copy/paste data is exactly the same for each sheet. Some
sheets will have up to 52 rows populated across colums M:AN, but some will
only have 4 rows populated, as all null values are returned as blank
(intentionally). All of the sheets have actual names (not "Sheet 1", etc.).
I would like to have all of the data pasted to one sheet, named "Copy.Paste".

Is there any way to have the macro run for each sheet, pasting data
underneath the previous entry, leaving only one completely empty row between
each set of data?

One other thing, the amount of sheets may increase or decrease over time, so
I would need the macro to run for all of the sheets up until the "Copy.Paste"
sheet.

Is this possible?

I appreciate any help you can provide.

Thanks,

Shoney
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro to Copy/Paste Data into one wksht, skipp one row before past

I'm confused, but maybe...

Dim wks as worksheet
dim RngToCopy as range
dim DestCell as range

'first paste goes here.
Set DestCell = worksheets("copy.paste").range("a1")

for each wks in activeworkbook.worksheets
if lcase(wks.name) = lcase("copy.paste") then
'skip it
else
set rngtocopy = wks.range("M1:AN52")
rngtocopy.copy _
destination:=destcell
set destcell = destcell.offset(rngtocopy.rows.count,0)
end if
next wks

========
Untested, uncompiled. Watch for typos.




Shoney wrote:

Hi,

I'm working w/about 100 tabs that contain data. I have a macro that will
copy and paste the data and have tested it on three tabs (recorded macro). I
also have a macro to delete empty rows between data. I could continue to
record the macro for all of the tabs, but as you can imagine, that may take a
while.

The range of the copy/paste data is exactly the same for each sheet. Some
sheets will have up to 52 rows populated across colums M:AN, but some will
only have 4 rows populated, as all null values are returned as blank
(intentionally). All of the sheets have actual names (not "Sheet 1", etc.).
I would like to have all of the data pasted to one sheet, named "Copy.Paste".

Is there any way to have the macro run for each sheet, pasting data
underneath the previous entry, leaving only one completely empty row between
each set of data?

One other thing, the amount of sheets may increase or decrease over time, so
I would need the macro to run for all of the sheets up until the "Copy.Paste"
sheet.

Is this possible?

I appreciate any help you can provide.

Thanks,

Shoney


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare two wk sheets with common data using copy paste macro conejo Excel Worksheet Functions 0 October 8th 07 09:21 AM
Can I copy page set ups in Excel 2003 from one wksht to another MHacct Excel Worksheet Functions 1 August 9th 07 05:40 PM
How to create a macro which performs a copy-and-paste task every 5mins after data is refreshed from web page? ­»´ä®a©~¸Ë­× Excel Worksheet Functions 0 December 5th 06 08:57 AM
Macro: Insert, copy and past data from sheet Metaldream7 Excel Discussion (Misc queries) 0 November 8th 06 09:31 PM
How do you copy and past data from one spreadsheet to another? trainer07 Excel Discussion (Misc queries) 1 August 9th 06 07:21 PM


All times are GMT +1. The time now is 08:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"