Link to home
Start Free TrialLog in
Avatar of dabug80
dabug80

asked on

Excel: Increase Cell Height By Altering Cell Value

Hello,

I would like to be able to alter the height of three given rows in Excel. See the attached spreadsheet

A user would alter the orange values and the corresponding coloured row(s) would increase or decrease in height.

What's the best way of doing this?

Thanks,
Increase-Cell-Height.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Probably worth adding a check that it is one of the cells in the range C3:C5 that have changed otherwise every change will trigger the macro.

Thanks
Rob H
Avatar of Rgonzo1971
Rgonzo1971

just what I thought

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not (Intersect(Target, Range("C3:C5")) Is Nothing) Then
    Range("7:7").RowHeight = Range("C3")
    Range("10:10").RowHeight = Range("C4")
    Range("13:13").RowHeight = Range("C5")
End If
End Sub
Avatar of dabug80

ASKER

Thanks for also supplying the standard value