Solved

Auto set every other row height in large spreadsheet

Posted on 2014-07-30
10
2,019 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

726 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