Solved

Auto set every other row height in large spreadsheet

Posted on 2014-07-30
10
1,718 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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
 

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
.Range Set 25 78
Excel Conditional Statements 11 38
conditional formatting 4 42
Left trim cells in column A Excel vba 2 31
Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

777 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