Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Row Hieght/Coulmn Width

How can I copy the Row Hieght and Column Width from one sheet to another
within the same workbook?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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
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
Using a variable row hieght in Excel jerrybdot Excel Discussion (Misc queries) 3 September 25th 09 06:52 PM
Wrap around setting won't adjust row hieght Irvine, Dennis Excel Discussion (Misc queries) 3 January 15th 08 12:06 AM
What is the difference between column width and row hieght? Leola Schultz Setting up and Configuration of Excel 1 August 9th 06 11:31 PM
auto expand row hieght of merged cells VBA-Beginner[_2_] Excel Programming 0 June 28th 05 04:34 PM
How to do two way lookup for more than 400 row & Coulmn? shital shah Excel Worksheet Functions 5 February 6th 05 11:22 AM


All times are GMT +1. The time now is 08:20 PM.

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"