Simple request.
I'm trying to force Excel to open to a specific cell (say A1) on Sheet 1 each time the workbook is open. Sheet 1 is named Start. Any suggestions? I'm not good at coming up with code but just fine copying and pasting.
Thanks.
Simple request.
I'm trying to force Excel to open to a specific cell (say A1) on Sheet 1 each time the workbook is open. Sheet 1 is named Start. Any suggestions? I'm not good at coming up with code but just fine copying and pasting.
Thanks.
Last edited by jasvetmed; 02-15-2009 at 10:58 AM.
This will do it, but it will require that you allow macros to run when you open the workbook.
Alt-F11 to open the VBEditor
Doubleclick on ThisWorkbook
Paste in this code:
Alt-F11 to close the workbook![]()
Please Login or Register to view this content.
Save the sheet
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
put this in workbook module![]()
Please Login or Register to view this content.
Thanks. Works great.
Now, How do I stop the notification from asking to turn on the macro each and every time I open the file?
Not sure that's a good idea to do, but in 2003 it's in Tools > Options > Security > Macro Security.
That warning is there for a reason. I wouldn't recommend lowering the security settings.
I understand completely. It's just that several people will be accessing the workbook and I'm afraid that most of them will bypass not allowing the macro to run thus defeating my original intention. Any other workarounds?
Nope. You can't control how others configure their Excel.
There are some more complicated solutions though, like putting a bunch of macros in to hide all the sheets except a front sheet that says "macros disabled". The macros would also hide the front sheet and unhide all the other sheets as part of the workbook_open event, so if they don't enable macros, they can't see any of the sheets, can't use the book.
That does sound like a complicated way of working around the macro deal. Let me think it over.
How much work would there be in setting something up like that?
Just pasting in some more code to the workbook module:
http://www.excelguru.ca/node/91
I'll give it a try.
I greatly appreciate your help!![]()
Sounds good.
Meanwhile, if you're satisfied with the solution offered to your original question, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]
Okay. So now I have a followup question/issue:
I would like to combine the two macros into the same workbook.
This would result in the user opening the workbook and being forced to enable macros for the entire workbook by utilizing the macro you referenced in your hyperlink. (which works fine)
Once that occurs, then I would like for the workbook to automatically open to cell A1 by utilizing the first macro you posted.
Not really sure how to paste two separate macros into the same workbook.
Any advice?
Nevermind. I figured out a work around. Thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks