PC Review


Reply
Thread Tools Rate Thread

Copy sheets with content into same workbook

 
 
A. Karatas
Guest
Posts: n/a
 
      27th Mar 2007
Hi,

I want to build a macro in which 6 particular sheets are copied (with
content, formulas and pivottables) and put at the end of the workbook.
The problem with recording is that the original sheets can differ from
sheet name on each update of the database because of a macro that
looks at a certain cell of that particular sheet and than renames
accordingly (after updating the pivot). Today the sheet name can be
6a- CELL- SRMS-AD and the next time 6a- NUT -SRMS-AD.
At recording it looks like this, but this is not working for me. Any
help???


Sub multiplysheets()
' multiplysheets Macro
' Macro recorded 27-3-2007 by Karata01

Sheets(Array("6a- Cell-SRMS-AD YTD", "6b- Cell-SRMS-AD-CUS YTD", _
"6c- Cell-SRMS-AD-CUS YTD", "6d- Cell-SRMS-A-P-C YTD", "6e-
Cell-Enduse YTD", _
"6f- Cell-SRMS-cntry YTD")).Select
Sheets("6f- Cell-SRMS-cntry YTD").Activate
Sheets(Array("6a- Cell-SRMS-AD YTD", "6b- Cell-SRMS-AD-CUS YTD", _
"6c- Cell-SRMS-AD-CUS YTD", "6d- Cell-SRMS-A-P-C YTD", "6e-
Cell-Enduse YTD", _
"6f- Cell-SRMS-cntry YTD")).Copy Before:=Sheets(53)
End Sub

Thanks in advance

 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      27th Mar 2007
A macro can only copy particular sheets if they can be identified in some
way - by name, position, content, selection, etc. Once you can lay out the
rules for identifying the sheets a macro can be written to use it.

--
Jim
"A. Karatas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| Hi,
|
| I want to build a macro in which 6 particular sheets are copied (with
| content, formulas and pivottables) and put at the end of the workbook.
| The problem with recording is that the original sheets can differ from
| sheet name on each update of the database because of a macro that
| looks at a certain cell of that particular sheet and than renames
| accordingly (after updating the pivot). Today the sheet name can be
| 6a- CELL- SRMS-AD and the next time 6a- NUT -SRMS-AD.
| At recording it looks like this, but this is not working for me. Any
| help???
|
|
| Sub multiplysheets()
| ' multiplysheets Macro
| ' Macro recorded 27-3-2007 by Karata01
|
| Sheets(Array("6a- Cell-SRMS-AD YTD", "6b- Cell-SRMS-AD-CUS YTD", _
| "6c- Cell-SRMS-AD-CUS YTD", "6d- Cell-SRMS-A-P-C YTD", "6e-
| Cell-Enduse YTD", _
| "6f- Cell-SRMS-cntry YTD")).Select
| Sheets("6f- Cell-SRMS-cntry YTD").Activate
| Sheets(Array("6a- Cell-SRMS-AD YTD", "6b- Cell-SRMS-AD-CUS YTD", _
| "6c- Cell-SRMS-AD-CUS YTD", "6d- Cell-SRMS-A-P-C YTD", "6e-
| Cell-Enduse YTD", _
| "6f- Cell-SRMS-cntry YTD")).Copy Before:=Sheets(53)
| End Sub
|
| Thanks in advance
|


 
Reply With Quote
 
A. Karatas
Guest
Posts: n/a
 
      28th Mar 2007
So, for example, can I not use the sheetnumbering as seen in VBA.
sheet 15(6a-CELLblablabla). Sheet 15 doesn't change (the name does).
Or is it possible to give a particular cell in a sheet a value and let
a macro search the workbook and each time it finds the value copy the
complete sheet???

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search for the cell content between sheets and copy corresponding Venkat Microsoft Excel Programming 2 25th Sep 2009 02:27 PM
Copy two sheets from workbook & create new workbook Mike R. Microsoft Excel Programming 8 7th Aug 2009 07:09 PM
Re: Copy all worksheets to another workbook, excl. duplicate sheets already in other workbook Chip Pearson Microsoft Excel Programming 0 26th May 2009 04:27 PM
Copy Two Visible Ranges (From Two Sheets) To A New Workbook (AlsoWith Two Sheets) septhemis@gmail.com Microsoft Excel Programming 3 30th Jan 2009 04:20 PM
Re: Copy Two Visible Ranges (From Two Sheets) To A New Workbook (AlsoWith Two Sheets) septhemis@gmail.com Microsoft Excel Programming 0 29th Jan 2009 01:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:53 PM.