I have a worksheet with multiple ActiveX Command buttons that pretty much do the same thing but only to different rows. Here’s a sample of the code I’m using.
Code: Select all
With ActiveSheet.Rows("18:18")
If .RowHeight > 160 Then
.RowHeight = 24
Else
.RowHeight = .RowHeight + 155
End If
End With
If ActiveSheet.Rows("18:18").RowHeight > 25 Then
MsgBox ("Row height increased ")
End If
Is there an easier way to accomplish this without having to repeat code for each command button? I’d like to keep the buttons. I thought of using a Case statement, but not sure that will work. I know I could use Worksheet change event or Double click event but like the idea of buttons, any thoughts