ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Row Height equivalent to xlColumnWidths? (https://www.excelbanter.com/excel-programming/292256-row-height-equivalent-xlcolumnwidths.html)

Mark Worthington

Row Height equivalent to xlColumnWidths?
 
Is there a Row Height equivalent to xlColumnWidths? I have searched,
but have had no luck.

Given that I can't seem to do it manually, I can guess the answer, but
someone out there may know better ...

Many thanks,

Mark

Jim Rech

Row Height equivalent to xlColumnWidths?
 
What is xlColumnWidths?

--
Jim Rech
Excel MVP



Mark Worthington[_2_]

Row Height equivalent to xlColumnWidths?
 
Jim,

Using the macro recorder to copy/paste Column Widths gives the following
:

Selection.PasteSpecial Paste:=xlColumnWidths

Excel 2000 does not recognise xlColumnWidths (a bug) and a workaround is
to use Paste:=8 ... but xlColumnWidths it doesn't work in my Excel 2002
either, but that's another story.

Anyway, while the Paste Special dialog has the option to paste Column
Widths, there is no option for Row Heights. While the obvious answer is
"it can be done in this manner, write some code", I was wondering if
there actually is some method ....

Regards,

Mark

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jim Rech

Row Height equivalent to xlColumnWidths?
 
The constant is xlPasteColumnWidths in Excel 2002 and 2003. This doesn't
work in 2000 as you know so since "8" works in all versions (post Excel 97)
that may be the way to go.

There is no xlPasteRowHeights unfortunately. The workarounds are (1)
copy/paste entire rows. When an entire row is copied the row height comes
along. (2) A macro that adjusts each destination row to match its
corresponding source row height. Good enough?


--
Jim Rech
Excel MVP



Mark Worthington

Row Height equivalent to xlColumnWidths?
 
Jim,

THanks for pointing out the 2002 xlPasteColumnWidths. No wonder I
couldn't get xlColumnWidths to work!

Yes, that is good enough.

Ta,

Mark


"Jim Rech" wrote in message ...
The constant is xlPasteColumnWidths in Excel 2002 and 2003. This doesn't
work in 2000 as you know so since "8" works in all versions (post Excel 97)
that may be the way to go.

There is no xlPasteRowHeights unfortunately. The workarounds are (1)
copy/paste entire rows. When an entire row is copied the row height comes
along. (2) A macro that adjusts each destination row to match its
corresponding source row height. Good enough?



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com