Skip to main content

 How to change the row height / column width alternated in Excel?

Supposing you have a large worksheet which has multiple columns or rows need to be adjusted their width or height alternately, you can change the row height or column width one by one manually if there is few columns or rows. But, how could you change multiple row height or column width at once in Excel?

Change every other row height with Filter function

Change every other row height / column width with VBA code

Change every other row height / column width with Kutools for Excel


arrow blue right bubble Change every other row height with Filter function

By using the Filter function, you need to create a helper column firstly, and then apply the Filter feature to filter your need rows, and adjust all the filtered row height at once. Please do as this:

1. Besides your data, in a blank cell, please enter the number 0 and 1 separately in first and second row, and then select them, and drag the fill handle over to the range cells that you want to adjust the row height, and check Copy Cells form the fill handle, and you will get the result as following screenshot:

doc-change-row-height-1

2. Then select the helper column, and click Data > Filter, then click doc-filter-button-1button and select 0 or 1 from the drop down list, this example, I will select 0, see screenshot:

doc-change-row-height-1

3. Click OK, all the rows which contains the number 0 have been filtered. And then select these filtered rows, and click Home > Format > Row Height, see screenshot:

doc-change-row-height-1

4. In the Row Height dialog, please enter the row height you want, see screenshot:

doc-change-row-height-1

5. Then click OK to close this dialog box, and your selected filtered row height have been adjusted. Lastly, click Data > Filter to cancel the filter feature, and your row height has been changed alternately. See screenshot:

doc-change-row-height-1

Notes:

1. You can change the row height alternately starts at the first row.

2. This method is not applied to change the column width.

3. After finishing the procedure, you can delete the helper column as you need.


arrow blue right bubble Change every other row height / column width with VBA code

If you need to change both the row height and column width, the following VBA code can do you a favor.

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: Change every other row height in a worksheet

Sub RowHeight()
'Update 20140625
Dim Rng As Range
Dim WorkRng As Range
Dim xInput As Long
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
xInput = Application.InputBox("Row height", xTitleId, "", Type:=2)
For i = 1 To WorkRng.Rows.Count Step 2
    WorkRng.Rows(i).RowHeight = xInput
Next
End Sub

3. Then press F5 key to execute this code, and a prompt box will pop out to remind you to select the range which you want to adjust the row height, see screenshot:

doc-change-row-height-1

4. And then click OK, another prompt box will pop out to let you enter the row height you need, see screenshot:

doc-change-row-height-1

5. And then click OK, your selected range row height has been changed alternately from the first row. See screenshot:

doc-change-row-height-1

Notes:

1. If you want to adjust every other column width, please apply the following VBA code:

VBA code: Change every other column width in a worksheet

Sub CloumnWidth()
'Update 20140625
Dim Rng As Range
Dim WorkRng As Range
Dim xInput As Long
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
xInput = Application.InputBox("Cloumn width", xTitleId, "", Type:=2)
For i = 1 To WorkRng.Columns.Count Step 2
    WorkRng.Columns(i).ColumnWidth = xInput
Next
End Sub

2. If you want to change the row height or column width begins at the second row / column, you just need to select the data range from the second row / column.


arrow blue right bubble Change every other row height / column width with Kutools for Excel

If you have installed Kutools for Excel, its Select Interval Rows & Columns utility also can help you to select every other row or column first, and then change the row height and column width at the same time.

Kutools for Excel includes more than 300 handy Excel tools. Free to try with no limitation in 30 days.Get it Now.

1. Select the data range that you want to use.

2. Go to click Kutools > Select Tools > Select Interval Rows & Columns, see screenshot:

doc-change-row-height-1

3. In the Select Interval Rows & Columns dialog box, check Rows or Columns from the Select section as you want, and then from the Options section, enter the Interval of and Columns or Rows number into them, in this example, I will choose columns, see screenshot:

doc-change-row-height-1

4. Then click OK, every other column has been selected in the section, see screenshot:

doc-change-row-height-1

5. And then click Home > Format > Column Width, and enter the column widths number that you like into the Column Width dialog box, see screenshots:

doc-change-row-height-11 -2 doc-change-row-height-12

6. Then click OK, and the column width has been changed alternately from the first column.

doc-change-row-height-1

Notes:

1. To select every other row, please check Rows in Select Interval Rows & Columns dialog in step 3.

2. If you want to change the row height or column width begins at the second row / column, you just need to select the data range from the second row / column.


Related articles:

How to shade every other or alternate rows in Excel?

How to quickly delete every other row in Excel?

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations