Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Hieght/Coulmn Width
How can I copy the Row Hieght and Column Width from one sheet to another
within the same workbook? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Hieght/Coulmn Width
In general
Sheets(2).Rows(1).RowHeight = Sheets(1).Rows(1).RowHeight Sheets(2).Columns(1).ColumnWidth = Sheets(1).Columns(1).ColumnWidth Or assign the source sheet height and width to variables and use that e.g for height..... Dim iH As Double iH = Sheets(1).Rows(1).RowHeight Sheets(2).Rows(1).RowHeight = iH you can also assign this to more than one row (or column). Sheets(2).Rows("1:10").RowHeight = iH -- Regards, Nigel "Dorian C. Chalom" wrote in message ... How can I copy the Row Hieght and Column Width from one sheet to another within the same workbook? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Hieght/Coulmn Width
OK I was thinking like your first example...
But lets say I want to loop through all the rows and columns. How do I determine the last row and column used? Can I do that? "Nigel" wrote in message ... In general Sheets(2).Rows(1).RowHeight = Sheets(1).Rows(1).RowHeight Sheets(2).Columns(1).ColumnWidth = Sheets(1).Columns(1).ColumnWidth Or assign the source sheet height and width to variables and use that e.g for height..... Dim iH As Double iH = Sheets(1).Rows(1).RowHeight Sheets(2).Rows(1).RowHeight = iH you can also assign this to more than one row (or column). Sheets(2).Rows("1:10").RowHeight = iH -- Regards, Nigel "Dorian C. Chalom" wrote in message ... How can I copy the Row Hieght and Column Width from one sheet to another within the same workbook? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Hieght/Coulmn Width
Depending on what you want...
For last displayed value ========================== LastUsedRow = ActiveSheet.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row LastUsedCol = ActiveSheet.Cells.Find(What:="*", SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Column For last value or formula =============================== LastUsedRow = ActiveSheet.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row LastUsedCol = ActiveSheet.Cells.Find(What:="*", SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, LookIn:=xlFormulas).Column That "last value or formula" one will find the last cell with an actual value or with a formula in it even if the formula evaluates to the empty string (""). -- Rick (MVP - Excel) "Dorian C. Chalom" wrote in message ... OK I was thinking like your first example... But lets say I want to loop through all the rows and columns. How do I determine the last row and column used? Can I do that? "Nigel" wrote in message ... In general Sheets(2).Rows(1).RowHeight = Sheets(1).Rows(1).RowHeight Sheets(2).Columns(1).ColumnWidth = Sheets(1).Columns(1).ColumnWidth Or assign the source sheet height and width to variables and use that e.g for height..... Dim iH As Double iH = Sheets(1).Rows(1).RowHeight Sheets(2).Rows(1).RowHeight = iH you can also assign this to more than one row (or column). Sheets(2).Rows("1:10").RowHeight = iH -- Regards, Nigel "Dorian C. Chalom" wrote in message ... How can I copy the Row Hieght and Column Width from one sheet to another within the same workbook? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using a variable row hieght in Excel | Excel Discussion (Misc queries) | |||
Wrap around setting won't adjust row hieght | Excel Discussion (Misc queries) | |||
What is the difference between column width and row hieght? | Setting up and Configuration of Excel | |||
auto expand row hieght of merged cells | Excel Programming | |||
How to do two way lookup for more than 400 row & Coulmn? | Excel Worksheet Functions |