Got any Excel/VBA Questions? Free Excel Help
Add a Minimize/Maximize Button to a UserForm
Here is a nice simple method you can use for a Minimize/Maximize Button on a UserForm. Just add a ToggleButton to the top of the UserForm. Adjust 0.25 to suit your needs.
Dim dHeight As Double
Private Sub ToggleButton1_Click()
If ToggleButton1.Value = True Then
Me.Height = Me.Height * 0.25
Else
Me.Height = dHeight
End If
End Sub
Private Sub UserForm_Initialize()
dHeight = Me.Height
End Sub
| Loop All Worksheets/Sheets in Workbook & Apply Code |
| Excel VBA Loops Explained |
| Loop Through a Folder of Excel Workbooks |
| Mask Date Entry in Excel |
| Mask Time Entry in Excel |
See also Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions.
Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.