Increase row heights base upon number in another cell

jono7gold

New Member
Joined
Sep 26, 2013
Messages
28
Hi, hope someone can help??

I want to change the row height base upon a number value in another cell, I would like this to apply across 5 rows.
So if A1 = 5 then row G will be a height of 5, if no cell value is entered in A1 then the height would be 0. Can this also be applied to B1 changing row H, C1 to row I, D1 to row J & E1 to row K.

Thank you.

Jon
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Actually if you could find a solution of using a formula that would be great, the exact formulas are:
=A1=C1/2
=A2=A1
=A3=C3
=A4=C4/2
=A5=A4

Thanks again.
 
Upvote 0
Thanks for the formulas. Replace the previous worksheet change code with this one.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  Dim c As Range
  
  If Not Intersect(Target, Range("C1,C3,C4")) Is Nothing Then
    For Each c In Range("A1:A5")
      If Len(c.Value) > 0 Then
        If IsNumeric(c.Value) Then
          On Error Resume Next
          Rows(c.Row + 9).RowHeight = c.Value
          On Error GoTo 0
        End If
      End If
    Next c
  End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top