Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 65
Default Multiple Sheet copying

Hi, I have 12 worksheets of data in one workbook.
I need to copy, paste special, values these all to another empty sheet.

Each sheet needs to start where the last one finished - ie. sheet 1 has 1300
rows of data so sheet 2 should copy after it from row 1301.

I know of course I can do this manually by copying and pasting each sheet
one at a time but is there an excel tool that can do this?
I dont know macro programming and I cant use macro recording because the
number of rows changes in each of the 12 sheets every month.

thanks to anyone that can help relieve me of this laborious task!
Rob
--
Rob Gaffney
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Multiple Sheet copying

Hi,

This copies the used range of every sheet to a sheet called summary. Change
Summary to the name of your sheet for the compiled data.

Right click any sheet tab, view code and paste this in and run it

Sub servient()
destsheet = "Summary" 'change to suit
For x = 1 To Worksheets.Count
If Sheets(x).Name = destsheet Then GoTo getmeout
lastrow = Sheets(destsheet).Cells(Cells.Rows.Count, "A").End(xlUp).Row
Sheets(x).UsedRange.Copy Destination:=Sheets(destsheet).Range("A" &
lastrow + 1)
getmeout:
Next
End Sub

Mike

"Gaffnr" wrote:

Hi, I have 12 worksheets of data in one workbook.
I need to copy, paste special, values these all to another empty sheet.

Each sheet needs to start where the last one finished - ie. sheet 1 has 1300
rows of data so sheet 2 should copy after it from row 1301.

I know of course I can do this manually by copying and pasting each sheet
one at a time but is there an excel tool that can do this?
I dont know macro programming and I cant use macro recording because the
number of rows changes in each of the 12 sheets every month.

thanks to anyone that can help relieve me of this laborious task!
Rob
--
Rob Gaffney

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 65
Default Multiple Sheet copying

Hi Mike
Thanks for the code. Sadly, it does not work.
I get a Compile Error : Syntax Error.




--
Rob Gaffney


"Mike H" wrote:

Hi,

This copies the used range of every sheet to a sheet called summary. Change
Summary to the name of your sheet for the compiled data.

Right click any sheet tab, view code and paste this in and run it

Sub servient()
destsheet = "Summary" 'change to suit
For x = 1 To Worksheets.Count
If Sheets(x).Name = destsheet Then GoTo getmeout
lastrow = Sheets(destsheet).Cells(Cells.Rows.Count, "A").End(xlUp).Row
Sheets(x).UsedRange.Copy Destination:=Sheets(destsheet).Range("A" &
lastrow + 1)
getmeout:
Next
End Sub

Mike

"Gaffnr" wrote:

Hi, I have 12 worksheets of data in one workbook.
I need to copy, paste special, values these all to another empty sheet.

Each sheet needs to start where the last one finished - ie. sheet 1 has 1300
rows of data so sheet 2 should copy after it from row 1301.

I know of course I can do this manually by copying and pasting each sheet
one at a time but is there an excel tool that can do this?
I dont know macro programming and I cant use macro recording because the
number of rows changes in each of the 12 sheets every month.

thanks to anyone that can help relieve me of this laborious task!
Rob
--
Rob Gaffney

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Multiple Sheet copying

Hi,

It line wrapped in posting

Sheets(x).UsedRange.Copy Destination:=Sheets(destsheet).Range("A" &
lastrow + 1)

This bit is all one line

Mike

"Gaffnr" wrote:

Hi Mike
Thanks for the code. Sadly, it does not work.
I get a Compile Error : Syntax Error.




--
Rob Gaffney


"Mike H" wrote:

Hi,

This copies the used range of every sheet to a sheet called summary. Change
Summary to the name of your sheet for the compiled data.

Right click any sheet tab, view code and paste this in and run it

Sub servient()
destsheet = "Summary" 'change to suit
For x = 1 To Worksheets.Count
If Sheets(x).Name = destsheet Then GoTo getmeout
lastrow = Sheets(destsheet).Cells(Cells.Rows.Count, "A").End(xlUp).Row
Sheets(x).UsedRange.Copy Destination:=Sheets(destsheet).Range("A" &
lastrow + 1)
getmeout:
Next
End Sub

Mike

"Gaffnr" wrote:

Hi, I have 12 worksheets of data in one workbook.
I need to copy, paste special, values these all to another empty sheet.

Each sheet needs to start where the last one finished - ie. sheet 1 has 1300
rows of data so sheet 2 should copy after it from row 1301.

I know of course I can do this manually by copying and pasting each sheet
one at a time but is there an excel tool that can do this?
I dont know macro programming and I cant use macro recording because the
number of rows changes in each of the 12 sheets every month.

thanks to anyone that can help relieve me of this laborious task!
Rob
--
Rob Gaffney

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 65
Default Multiple Sheet copying

thanks mike - better but now getting a "runtime error 9 - subscript out of
range" error
--
Rob Gaffney


"Mike H" wrote:

Hi,

It line wrapped in posting

Sheets(x).UsedRange.Copy Destination:=Sheets(destsheet).Range("A" &
lastrow + 1)

This bit is all one line

Mike

"Gaffnr" wrote:

Hi Mike
Thanks for the code. Sadly, it does not work.
I get a Compile Error : Syntax Error.




--
Rob Gaffney


"Mike H" wrote:

Hi,

This copies the used range of every sheet to a sheet called summary. Change
Summary to the name of your sheet for the compiled data.

Right click any sheet tab, view code and paste this in and run it

Sub servient()
destsheet = "Summary" 'change to suit
For x = 1 To Worksheets.Count
If Sheets(x).Name = destsheet Then GoTo getmeout
lastrow = Sheets(destsheet).Cells(Cells.Rows.Count, "A").End(xlUp).Row
Sheets(x).UsedRange.Copy Destination:=Sheets(destsheet).Range("A" &
lastrow + 1)
getmeout:
Next
End Sub

Mike

"Gaffnr" wrote:

Hi, I have 12 worksheets of data in one workbook.
I need to copy, paste special, values these all to another empty sheet.

Each sheet needs to start where the last one finished - ie. sheet 1 has 1300
rows of data so sheet 2 should copy after it from row 1301.

I know of course I can do this manually by copying and pasting each sheet
one at a time but is there an excel tool that can do this?
I dont know macro programming and I cant use macro recording because the
number of rows changes in each of the 12 sheets every month.

thanks to anyone that can help relieve me of this laborious task!
Rob
--
Rob Gaffney



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Multiple Sheet copying

On which line? hve you got a sheet called Summary?

You need to have a named sheet to copy the data to and that name must appear
in the code here

destsheet = "Summary"

Mike



"Gaffnr" wrote:

thanks mike - better but now getting a "runtime error 9 - subscript out of
range" error
--
Rob Gaffney


"Mike H" wrote:

Hi,

It line wrapped in posting

Sheets(x).UsedRange.Copy Destination:=Sheets(destsheet).Range("A" &
lastrow + 1)

This bit is all one line

Mike

"Gaffnr" wrote:

Hi Mike
Thanks for the code. Sadly, it does not work.
I get a Compile Error : Syntax Error.




--
Rob Gaffney


"Mike H" wrote:

Hi,

This copies the used range of every sheet to a sheet called summary. Change
Summary to the name of your sheet for the compiled data.

Right click any sheet tab, view code and paste this in and run it

Sub servient()
destsheet = "Summary" 'change to suit
For x = 1 To Worksheets.Count
If Sheets(x).Name = destsheet Then GoTo getmeout
lastrow = Sheets(destsheet).Cells(Cells.Rows.Count, "A").End(xlUp).Row
Sheets(x).UsedRange.Copy Destination:=Sheets(destsheet).Range("A" &
lastrow + 1)
getmeout:
Next
End Sub

Mike

"Gaffnr" wrote:

Hi, I have 12 worksheets of data in one workbook.
I need to copy, paste special, values these all to another empty sheet.

Each sheet needs to start where the last one finished - ie. sheet 1 has 1300
rows of data so sheet 2 should copy after it from row 1301.

I know of course I can do this manually by copying and pasting each sheet
one at a time but is there an excel tool that can do this?
I dont know macro programming and I cant use macro recording because the
number of rows changes in each of the 12 sheets every month.

thanks to anyone that can help relieve me of this laborious task!
Rob
--
Rob Gaffney

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 65
Default Multiple Sheet copying

Thanks mike, works like a dream.
Last question if i may.

This has created 12 macros. Is there a way I can run them all at once?
--
Rob Gaffney


"Mike H" wrote:

Hi,

This copies the used range of every sheet to a sheet called summary. Change
Summary to the name of your sheet for the compiled data.

Right click any sheet tab, view code and paste this in and run it

Sub servient()
destsheet = "Summary" 'change to suit
For x = 1 To Worksheets.Count
If Sheets(x).Name = destsheet Then GoTo getmeout
lastrow = Sheets(destsheet).Cells(Cells.Rows.Count, "A").End(xlUp).Row
Sheets(x).UsedRange.Copy Destination:=Sheets(destsheet).Range("A" &
lastrow + 1)
getmeout:
Next
End Sub

Mike

"Gaffnr" wrote:

Hi, I have 12 worksheets of data in one workbook.
I need to copy, paste special, values these all to another empty sheet.

Each sheet needs to start where the last one finished - ie. sheet 1 has 1300
rows of data so sheet 2 should copy after it from row 1301.

I know of course I can do this manually by copying and pasting each sheet
one at a time but is there an excel tool that can do this?
I dont know macro programming and I cant use macro recording because the
number of rows changes in each of the 12 sheets every month.

thanks to anyone that can help relieve me of this laborious task!
Rob
--
Rob Gaffney

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 65
Default Multiple Sheet copying

mike, ignore that last piece. I see it has created a copy of all 12.
you are a genius. thanks so much.
Rob
--
Rob Gaffney


"Mike H" wrote:

Hi,

This copies the used range of every sheet to a sheet called summary. Change
Summary to the name of your sheet for the compiled data.

Right click any sheet tab, view code and paste this in and run it

Sub servient()
destsheet = "Summary" 'change to suit
For x = 1 To Worksheets.Count
If Sheets(x).Name = destsheet Then GoTo getmeout
lastrow = Sheets(destsheet).Cells(Cells.Rows.Count, "A").End(xlUp).Row
Sheets(x).UsedRange.Copy Destination:=Sheets(destsheet).Range("A" &
lastrow + 1)
getmeout:
Next
End Sub

Mike

"Gaffnr" wrote:

Hi, I have 12 worksheets of data in one workbook.
I need to copy, paste special, values these all to another empty sheet.

Each sheet needs to start where the last one finished - ie. sheet 1 has 1300
rows of data so sheet 2 should copy after it from row 1301.

I know of course I can do this manually by copying and pasting each sheet
one at a time but is there an excel tool that can do this?
I dont know macro programming and I cant use macro recording because the
number of rows changes in each of the 12 sheets every month.

thanks to anyone that can help relieve me of this laborious task!
Rob
--
Rob Gaffney

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
Copying Data from Multiple Sheets to One sheet MAB Excel Worksheet Functions 1 January 15th 08 08:28 PM
need help please inserting multiple rows based on cell value then copying to data sheet [email protected] Excel Worksheet Functions 1 July 1st 07 08:44 PM
copying one cell in multiple sheets into a column on one sheet LeahR Excel Worksheet Functions 3 June 1st 07 05:55 PM
Copying Cells From Multiple Worksheets to Create Summary Sheet lee Excel Discussion (Misc queries) 1 October 6th 06 05:13 PM
Opening Multiple files and Copying the info all to one other sheet MsLucy Excel Discussion (Misc queries) 2 January 6th 06 05:41 PM


All times are GMT +1. The time now is 12:41 PM.

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

About Us

"It's about Microsoft Excel"