Paste row height.

Jonno

New Member
Joined
Oct 29, 2002
Messages
47
Is it possible to paste purely a row height (no formats, values etc.)

It's simple enough to paste a column width using the Paste Special command, but what about rows - they seem a bit neglected :cry:

Thanks,

Jonno.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

jimboy

Well-known Member
Joined
Apr 11, 2002
Messages
2,314
How about selecting the whole row (keyboard shortcut Shift & Spacebar) - copying and PasteSpecial>Formats
 

Jonno

New Member
Joined
Oct 29, 2002
Messages
47
Thanks Jimboy. That takes all the formats with it though, I'm purely after just the row height.

Cheers,

Jonno.
 

jimboy

Well-known Member
Joined
Apr 11, 2002
Messages
2,314
I don't think there is a way, how about clearing the formats after you have pasted? (Edit>Clear>Formats) - this will clear your formats you had previously tho'.

You could always do a macro...
 

Jonno

New Member
Joined
Oct 29, 2002
Messages
47

ADVERTISEMENT

Can anyone assist with a VBA solution? :rolleyes:

Thanks,

Jonno.
 

Tom Urtis

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,273
All you want is row height?

Rows(5).RowHeight = Rows(1).RowHeight
will make the height of row 5 be whatever the height of row 1 is.

To do a few at once:
Range("5:9").RowHeight = Rows(1).RowHeight

Am I missing something or is there more to the question?
 

Jonno

New Member
Joined
Oct 29, 2002
Messages
47

ADVERTISEMENT

Tom,

I want to select a row and paste it's height to another row or rows without taking all the data and formats. Identical to 'paste column widths' in the Paste Special command but to suit row heights.

Thanks,

Jonno.
 

Tom Urtis

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,273
Did you try my code? It does what you say you want to do without the need for selecting anything.
 

jimboy

Well-known Member
Joined
Apr 11, 2002
Messages
2,314
How about this, it will bring up a inputbox, enter the row you want to copy in i.e. 10

Code:
Sub Copy_Row_Height()
On Error Resume Next
    Dim myrow As Variant
    
    myrow = InputBox("Which row height do you want to copy?")
    Rows(ActiveCell.Row).RowHeight = Rows(myrow).RowHeight
End Sub
 

Jonno

New Member
Joined
Oct 29, 2002
Messages
47
Thanks Tom. Your code does do want I need regarding matching the row heights, but I'd like to be able to select the 'from' and 'to' rows.

I'll end up having a 'Match Row' custom button assigned as I think this would be very useful.

Thanks once more,

Jonno. :)
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,024
Messages
5,856,875
Members
431,837
Latest member
megantang

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
Top