+ Reply to Thread
Results 1 to 13 of 13

Open to specific cell

  1. #1
    Registered User
    Join Date
    02-13-2009
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Open to specific cell

    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.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Open to specific cell

    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:
    Please Login or Register  to view this content.
    Alt-F11 to close the workbook
    Save the sheet
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon 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!)

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Open to specific cell

    Please Login or Register  to view this content.
    put this in workbook module

  4. #4
    Registered User
    Join Date
    02-13-2009
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Open to specific cell

    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?

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Open to specific cell

    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.

  6. #6
    Registered User
    Join Date
    02-13-2009
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Open to specific cell

    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?

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Open to specific cell

    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.

  8. #8
    Registered User
    Join Date
    02-13-2009
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Open to specific cell

    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?

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Open to specific cell

    Just pasting in some more code to the workbook module:

    http://www.excelguru.ca/node/91

  10. #10
    Registered User
    Join Date
    02-13-2009
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Open to specific cell

    I'll give it a try.
    I greatly appreciate your help!

  11. #11
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Open to specific cell

    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]

  12. #12
    Registered User
    Join Date
    02-13-2009
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Open to specific cell

    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?

  13. #13
    Registered User
    Join Date
    02-13-2009
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Open to specific cell

    Nevermind. I figured out a work around. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1