Solved

Auto set every other row height in large spreadsheet

Posted on 2014-07-30
10
1,493 Views
Last Modified: 2014-07-30
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
0
Comment
Question by:glophillips1
10 Comments
 
LVL 13

Expert Comment

by:duncanb7
ID: 40229511
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
0
 

Author Comment

by:glophillips1
ID: 40229570
Duncan,
I tried that and nothing happens when I select Auto Fit Row Height.  What am I doing wrong?
Gloria
0
 
LVL 13

Expert Comment

by:duncanb7
ID: 40229575
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
0
 
LVL 10

Expert Comment

by:FamousMortimer
ID: 40229586
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

0
 
LVL 13

Expert Comment

by:duncanb7
ID: 40229594
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
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:glophillips1
ID: 40229600
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
0
 
LVL 13

Expert Comment

by:duncanb7
ID: 40229603
Could you capture your excel image to us ?

Duncan
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
ID: 40229723
FamousMortimer's solution works and is fast (although, one only needs to adjust rows up to 1000, not the end of the sheet).

There is no Excel function available that will control row height.  However, one could add a helper column to identify the rows to be adjusted and then filter and adjust accordingly.

To do it manually:
1) Add or insert a helper column.  This can be deleted later.
2) In this helper column, go to the first row to be adjusted and enter the following formula:
=MOD(ROW(),2)
Note the result; it will either be 0 or 1.
3) Copy this formula down to row 1000 (or however many rows you need).
4) Turn on data filters and filter on the value (0 or 1) that is for the rows you want to adjust the height.
You should only see every other row.
5) Select all the visible, filtered rows.
6) Change the row height:
    a) Right-click on any row header
    b) Select "Row height..."
    c) Enter the new height
7) Turn off the filtering
8) Delete or hide the helper column (optional)

I've attached an example file that demonstrates this.

Regards,
-Glenn
EE-rowheight.xlsx
0
 

Author Comment

by:glophillips1
ID: 40229749
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
0
 

Author Closing Comment

by:glophillips1
ID: 40229766
This worked great!!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
My experience with Windows 10 over a one year period and suggestions for smooth operation
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now