Copying row heights of blocks: method

WaltzAir

New Member
Joined
Sep 19, 2012
Messages
33
Code following can be used to "pastespecial" row heights for blocks of cells that have been copied and have lost row height settings.
Prior to executing, the source block is selected, then PageSetup'd as the PrintArea.
The pasting begins at the activecell row and continues for the number of rows in the PrintArea.
The code is handy when assigned to a key combination.

cheers :)
'
'
Sub PasteSpecial_Heights()
'
' ******* copies row heights of PrintArea rows starting at activecell *******
'
Dim J As Integer, Block As Range
'
Set Block = Range(ActiveSheet.PageSetup.PrintArea)
'
For J = 1 To Block.Rows.Count
Selection.Offset(J - 1, 0).RowHeight = Block.Rows(J).RowHeight
Next J
'
End Sub
'
'
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,224,416
Messages
6,178,509
Members
452,853
Latest member
philipnjk64

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top