Link to home
Start Free TrialLog in
Avatar of glophillips1
glophillips1Flag for United States of America

asked on

Auto set every other row height in large spreadsheet

I have excel sheet that has 1000 rows and I want to format every other row to a different height?  Can I do this with an "If" statement?  I know there has to be a way to accomplish this just not sure how.
Thanks,
G
Avatar of duncanb7
duncanb7

Just  follow the instruction as follows
Click the Menus tab;
Click Format drop down menu;
Click Row item;
Then you will view the AutoFit Row Height item staying in the sub-item list of Row item. The Auto Fit Row Height is the right thing we are looking for.

Duncan
Avatar of glophillips1

ASKER

Duncan,
I tried that and nothing happens when I select Auto Fit Row Height.  What am I doing wrong?
Gloria
it should be okay if you are using Excel 2010 above excel 2007

You can not find tab  or you've  other issue ? please advise

Duncan
Is this what you are looking for?  You can add this to the Sheet code you would like to adjust the row heights on.

Sub SetRowHeights()
    Dim i As Integer
    
    For i = 1 To Range("A1048576").End(xlUp).Row
        If i Mod 2 = 0 Then Rows(i).RowHeight = 25
    Next i
End Sub

Open in new window

I found this arcitle for similar issue for Excel 10 at yahoo site
http://voices.yahoo.com/how-auto-fit-column-width-row-height-in-12467758.html
Duncan,

Okay, I go to Home, Format, then AutoFit Row Height in Excel 2010.  When I select AutoFIt Row Height nothing happens.  Am I in the right place?

Gloria
Could you capture your excel image to us ?

Duncan
ASKER CERTIFIED SOLUTION
Avatar of Glenn Ray
Glenn Ray
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I want even number rows to be 19.5 in height and the odd number to be at the default.  I have all rows mared with a mod function so they are either a 1 (odd) or 0 for even.   I think Famousmortimer your suggestion will work but I don't know how to get to that point.  Can you help.
Thanks,
Gloria
This worked great!!