Hello everybody. I'm as new to this forum as I am to excel VBA/Macros and I really need help from a pro.
I use Excel 2007 and run Windows XP.
The file has several sheets and works a lot with hyperlinks. The file needs to be protected because I cant have people making changes to it.
I have 2 problems that I would very much appreciate if someone could help me with.
I need for the file to open in the same sheet every time someone opens it regardless of if when they closed it they saved in another sheet. I created a sheet called HOME and I need the file to always open to that sheet. I tried the following but it doesn't work.
Private Sub Workbook_Open()
Worksheets("HOME").Activate
End Sub
I don't know where I have to place this code in the VBA project. Module/The Sheet/ThisWorkbook. Can anybody tell me why this is not working please.
The other problem is that since the file is protected, I can't group and Ungroup. I tried the following code:
Private Sub Workbook()
With Sheet2
.Protect Password:="Antonio123", UserInterfaceOnly:=True
.EnableOutlining = True
.EnableAutoFilter = True
.EnableCalculation = True
.EnableFormatConditionsCalculation = True
.EnableOutlining = True
.EnableSelection = xlLockedCells
End With
End Sub
Again, I don't know if I have to paste this in Module/The Sheet/ThisWorkbook.
The interesting thing is that this code sort of works. When I open the file it doesn't work even if I press enable macros, but if after I go to the VBA and on the sheet where the code is I press the play Icon on the toolbar above the code, it works.
Can one of you Excel geniuses help me out please!!!
Thank you and sorry for the long text, but don't know how else to explain this.
I use Excel 2007 and run Windows XP.
The file has several sheets and works a lot with hyperlinks. The file needs to be protected because I cant have people making changes to it.
I have 2 problems that I would very much appreciate if someone could help me with.
I need for the file to open in the same sheet every time someone opens it regardless of if when they closed it they saved in another sheet. I created a sheet called HOME and I need the file to always open to that sheet. I tried the following but it doesn't work.
Private Sub Workbook_Open()
Worksheets("HOME").Activate
End Sub
I don't know where I have to place this code in the VBA project. Module/The Sheet/ThisWorkbook. Can anybody tell me why this is not working please.
The other problem is that since the file is protected, I can't group and Ungroup. I tried the following code:
Private Sub Workbook()
With Sheet2
.Protect Password:="Antonio123", UserInterfaceOnly:=True
.EnableOutlining = True
.EnableAutoFilter = True
.EnableCalculation = True
.EnableFormatConditionsCalculation = True
.EnableOutlining = True
.EnableSelection = xlLockedCells
End With
End Sub
Again, I don't know if I have to paste this in Module/The Sheet/ThisWorkbook.
The interesting thing is that this code sort of works. When I open the file it doesn't work even if I press enable macros, but if after I go to the VBA and on the sheet where the code is I press the play Icon on the toolbar above the code, it works.
Can one of you Excel geniuses help me out please!!!
Thank you and sorry for the long text, but don't know how else to explain this.