Reputation: 1298
I have a excel with three Sheets, lets call them sheet1, sheet2, sheet3. I have few data points in sheet1, and sheet2 and based on those data points I want to calculate some outcomes in sheet3.
Now I hava created a form in which user could enter the datapoints for sheet1 and sheet2 and on clicking the OK button, sheet3 will be activated and outcomes will be shown.
My questions are: 1. how do i open the userform as soon as the excel file is opened. 2. i dont want to show sheet1 and sheet2 to the user as it also has some propriety datapoints. Given that i have the userform to fill in the required datapoints, how do i hide the actual sheet1 and sheet2?
Thanks in advance.
Upvotes: 0
Views: 50
Reputation: 564
Considering name of the userform to be Userform1, use the below code:
Private Sub Workbook_Open()
Sheet1.Visible = xlSheetVeryHidden
Sheet2.Visible = xlSheetVeryHidden
UserForm1.Show
End Sub
Upvotes: 1