Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
A C A C is offline
external usenet poster
 
Posts: 8
Default Q: copying PageSetup properties from one worksheet to another

Hi

Can someone tell me how to correctly copy the PageSetup properties from 1
worksheet to another. I would like to copy every property over but dont
want to write code listing every single property, I would like to do it
"automatically" in the code.

For example, will the following work properly?

myNewWorksheet.PageSetup = myOldWorksheet.PageSetup


Or is there a way to loop over the pageSetup properties?
eg
for each ??? in PageSetup
myNewWorksheet.PageSetup.???? = myOldWorksheet.PageSetup.???
next ???


Thanks
A


  #3   Report Post  
Posted to microsoft.public.excel.programming
A C A C is offline
external usenet poster
 
Posts: 8
Default copying PageSetup properties from one worksheet to another

Can you not copy the worksheet that has the page setup properties you want
to create and then clear the cells and any other irrelevant properties
within the copied sheet.


The short answer* is: No :) due to a whole lot of crummy details. I can
and do copy the new worksheet when making later worksheets, and that
inherits the PageSetup details so your suggestion is certainly a valid one.
Its just that for boring and long reasons I cannot do it for this first
one...

Thanks for the suggestion though
A

*Long answer for anyone who is interested.
The worksheet we are wanting to get the PageSetup info from is a "template"
style of worksheet. We have set up a full set of formulas and formatting
etc on this worksheet, but which formulas and formattings and rows/cols etc
we want is decided at execution time. So in other words during execution we
go to this "master template" sheet and based on certain parameters during
execution we pull various pieces of the master template out and apply them
to our worksheet, and leave the other pieces behind.
It works well, except for this pageSetup stuff which we *always* want. I am
unsure of the correct way to copy the pageSetup object properties from one
worksheet to another correctly.


--


XL2003
Regards

William



"A C" wrote in message
...
Hi

Can someone tell me how to correctly copy the PageSetup properties from

1
worksheet to another. I would like to copy every property over but dont
want to write code listing every single property, I would like to do it
"automatically" in the code.

For example, will the following work properly?

myNewWorksheet.PageSetup = myOldWorksheet.PageSetup


Or is there a way to loop over the pageSetup properties?
eg
for each ??? in PageSetup
myNewWorksheet.PageSetup.???? = myOldWorksheet.PageSetup.???
next ???


Thanks
A






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
Worksheet Properties - Last User John Calder New Users to Excel 1 May 11th 07 01:30 AM
Worksheet properties Jello Excel Programming 7 March 2nd 05 03:17 AM
worksheet Name and (Name) properties Mikhail Excel Programming 1 October 2nd 03 10:50 AM
Properties - Workbook and Worksheet Sandy[_3_] Excel Programming 1 September 6th 03 07:01 PM
resetting worksheet properties Michael J. Malinsky Excel Programming 1 July 15th 03 05:23 PM


All times are GMT +1. The time now is 08:25 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"