dss28
Board Regular
- Joined
- Sep 3, 2020
- Messages
- 165
- Office Version
- 2007
- Platform
- Windows
I have a macro based excel workbook which opens in a userform with a command button on it.
I want to open a worksheet in this workbook by clicking the command button.
The userform is closes but sheet does not open. However if the same workbook is again clicked, a message is displayed that "file is already open , do you want to open again" . I tried following codes but the sheet does not open.
what improvement to be done in the code. please guide.
I want to open a worksheet in this workbook by clicking the command button.
The userform is closes but sheet does not open. However if the same workbook is again clicked, a message is displayed that "file is already open , do you want to open again" . I tried following codes but the sheet does not open.
what improvement to be done in the code. please guide.
VBA Code:
Private Sub UserForm_Initialize()
With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 85)
Width = .Width
Height = .Height
End With
End Sub
Private Sub cmdWelcome_Click()
ThisWorkbook.Sheets("Calender").Visible = True
ThisWorkbook.Sheets("Calender").Select
End Sub
Private Sub UserForm_Terminate()
frmBackground.Show
ActiveWorkbook.Save
ActiveWorkbook.Close
Application.Quit
End Sub