Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,074
- Office Version
- 2019
- Platform
- Windows
I have a code that reduces the size and resize the useform back to the height default when i hover over my userform. Is there a way to reduce the size of my userform when I move away from the userform (i.e. cursor is not hovering over the userform)?
VBA Code:
Dim dHeight As Double
dHeight = 426
With Me
If .Height = dHeight Then
.Height = dHeight / 8
.Top = Abs(Application.Top) + (Application.Height) - (Me.Height + 10)
.Left = Abs(Application.Left) + (Application.Width) - (Me.Width + 10)
Else
.Height = 426
.Top = Application.Top + Application.Height / 2 - .Height / 2
.Left = Application.Left + Application.Width / 2 - .Width / 2
End If
End With