• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Row Height Macro

bkanne

Member
I've created an add-in that has this code in it as a module. Does anyone have an idea of how I could create an interface that would allow me to link the individual specified row heights specified in the code below into a user friendly format that would allow the user to change the row heights to their preference?

Probably too complicated of a question but thought I would ask! Thank you!

Code:
Sub RowCycle()

        With Selection
      
        If .RowHeight = 15 Then
        .RowHeight = 20
      
        ElseIf .RowHeight = 20 Then
        .RowHeight = 25
      
        ElseIf .RowHeight = 25 Then
        .RowHeight = 5
              
        ElseIf .RowHeight = 5 Then
        .RowHeight = 10
              
        Else
        .RowHeight = 15
      
        End If
      
        End With
            
      
End Sub
 
Last edited:
Hi,

If you wish to ask the user to input the desired Row Height, you can use an inputbox as below:

Code:
Sub SetRowHeight()

    Dim H As String

    H = InputBox("Set the desired height", "Edit Row Height", 15)
   
    If H = "" Then
        Exit Sub
    End If
   
    Selection.RowHeight = H

End Sub

The above will prompt the user to manually set the row height for the rows of the current selection.

Hope this helps
 
Back
Top