![]() |
Copy row/column size, print area...to other tabs
Hi,
Is it possible to copy row/column size, hidden columns/rows, print area, margins, header/footers from one tab to another tab and also to other tabs in other workbooks with a simple macro? I'm currently recorded the adjustments and applying it to each tab. Thanks, Carmen |
Copy row/column size, print area...to other tabs
yes, you can read and write most of these properties.
worksheets("Sheet2").Range("A1").EntireColumn.Colu mnWidth = _ worksheets("Sheet1").Range("A1").EntireColumn.Colu mnWidth You can get the names of the properties by turning on the macro recorder and manually changing some of them, then turn off the macro recorder and look at the recorded code. -- Regards, Tom Ogilvy as an example. "Carmen" wrote: Hi, Is it possible to copy row/column size, hidden columns/rows, print area, margins, header/footers from one tab to another tab and also to other tabs in other workbooks with a simple macro? I'm currently recorded the adjustments and applying it to each tab. Thanks, Carmen |
Copy row/column size, print area...to other tabs
Hi Carmen,
Do I assume that you are trying to make an exact duplicate of the worksheet? If so, right click on the tab name and select Move or Copy and check the box bottom left to copy and if to another workbook click on the drop down arrow beside the workbook name and select the required workbook or new workbook. If you are trying to copy into an existing workbook then the existing workbook needs to be open. However, if you are trying to copy to an existing worksheet then it does not work but if copying the entire worksheet, simply delete the existing one and rename the new one. Regards, OssieMac "Carmen" wrote: Hi, Is it possible to copy row/column size, hidden columns/rows, print area, margins, header/footers from one tab to another tab and also to other tabs in other workbooks with a simple macro? I'm currently recorded the adjustments and applying it to each tab. Thanks, Carmen |
Copy row/column size, print area...to other tabs
Hi OssieMac, I currently have a file with 20+tabs, some probably with more columns hidden than the others. I need to create a macro to save each one of them in individual files, and at the same time I need to set up their print area, size particular cells, hide certain rows, etc. Since this macro will be used with many similar scenarios (saving tabs to individual files), I want to make it as generic as possible. So I would like user to identify a tab with the desired format, hidden columns/rows, print setup... and then be able to copy the properties to all other tabs as they are being copied. Is this possible? Thanks, Carmen "OssieMac" wrote: Hi Carmen, Do I assume that you are trying to make an exact duplicate of the worksheet? If so, right click on the tab name and select Move or Copy and check the box bottom left to copy and if to another workbook click on the drop down arrow beside the workbook name and select the required workbook or new workbook. If you are trying to copy into an existing workbook then the existing workbook needs to be open. However, if you are trying to copy to an existing worksheet then it does not work but if copying the entire worksheet, simply delete the existing one and rename the new one. Regards, OssieMac "Carmen" wrote: Hi, Is it possible to copy row/column size, hidden columns/rows, print area, margins, header/footers from one tab to another tab and also to other tabs in other workbooks with a simple macro? I'm currently recorded the adjustments and applying it to each tab. Thanks, Carmen |
Copy row/column size, print area...to other tabs
sh1.cells.copy
Activesheet.Cells.pasteSpecial xlFormats This won't work for print settings. Again, you can record a macro to see how to get the properties of the pagesetup object. -- Regards, Tom Ogilvy "Carmen" wrote: Hi OssieMac, I currently have a file with 20+tabs, some probably with more columns hidden than the others. I need to create a macro to save each one of them in individual files, and at the same time I need to set up their print area, size particular cells, hide certain rows, etc. Since this macro will be used with many similar scenarios (saving tabs to individual files), I want to make it as generic as possible. So I would like user to identify a tab with the desired format, hidden columns/rows, print setup... and then be able to copy the properties to all other tabs as they are being copied. Is this possible? Thanks, Carmen "OssieMac" wrote: Hi Carmen, Do I assume that you are trying to make an exact duplicate of the worksheet? If so, right click on the tab name and select Move or Copy and check the box bottom left to copy and if to another workbook click on the drop down arrow beside the workbook name and select the required workbook or new workbook. If you are trying to copy into an existing workbook then the existing workbook needs to be open. However, if you are trying to copy to an existing worksheet then it does not work but if copying the entire worksheet, simply delete the existing one and rename the new one. Regards, OssieMac "Carmen" wrote: Hi, Is it possible to copy row/column size, hidden columns/rows, print area, margins, header/footers from one tab to another tab and also to other tabs in other workbooks with a simple macro? I'm currently recorded the adjustments and applying it to each tab. Thanks, Carmen |
All times are GMT +1. The time now is 07:01 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com