• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 158
  • Last Modified:

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
0
dabug80
Asked:
dabug80
  • 2
1 Solution
 
Rgonzo1971Commented:
Hi,

In sheet1 insert this code the height should be points (standard 12.75)

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("7:7").RowHeight = Range("C3")
Range("10:10").RowHeight = Range("C4")
Range("13:13").RowHeight = Range("C5")
End Sub


Regards
0
 
Rob HensonIT & Database AssistantCommented:
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
0
 
Rgonzo1971Commented:
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
0
 
dabug80Author Commented:
Thanks for also supplying the standard value
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now