+ Reply to Thread
Results 1 to 8 of 8

Save file so that next time it's opened Range A1 is active and in the window?

Hybrid View

  1. #1
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    77

    Save file so that next time it's opened Range A1 is active and in the window?

    Despite trying these 3 ways to make A1 active before saving the workbook, when I reopen the workbook later it will still be on column J. How can I save it on a certain column? I don't want a workbook open event. If I manually open a workbook and select a1 and then save, it works fine.

    'None of these have worked
    
    Range("A1").Select
    
    Range("A1").Activate
    
    Application.Goto Reference:=Sheets(1).Range("A1"), scroll:=True

  2. #2
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    77

    Re: Save file so that next time it's opened Range A1 is active and in the window?

    Quote Originally Posted by dmasters4919 View Post
    Despite trying these 3 ways to make A1 active before saving the workbook, when I reopen the workbook later it will still be on column J. How can I save it on a certain column? I don't want a workbook open event. If I manually open a workbook and select a1 and then save, it works fine.

    'None of these have worked
    
    Range("A1").Select
    
    Range("A1").Activate
    
    Application.Goto Reference:=Sheets(1).Range("A1"), scroll:=True

    I just came up with a silly work around but it works. If I add a sheet and then immediately delete it before selecting A1 I don't have this problem

        With Sheets.Add
            .Delete
        End With

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Save file so that next time it's opened Range A1 is active and in the window?


    Hi,

    if a file saved is not reopened at the same window position, check event code !

  4. #4
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    77

    Re: Save file so that next time it's opened Range A1 is active and in the window?

    What do you mean by the event code? I would prefer not to use a workbook_open event. Also unfortunately my workaround I posted yesterday is not working when I implemented it as part of the entire sub, despite working 100% of the time when testing that part only. Very frustrating

  5. #5
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: Save file so that next time it's opened Range A1 is active and in the window?

    Quote Originally Posted by dmasters4919 View Post
    I would prefer not to use a workbook_open event.
    Why?

    Simplest solution would be:

    workbook_open
    
    range("Sheetname!A1").select

  6. #6
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    77

    Re: Save file so that next time it's opened Range A1 is active and in the window?

    Quote Originally Posted by BellyGas View Post
    Why?

    Simplest solution would be:

    workbook_open
    
    range("Sheetname!A1").select
    Because the macro I'm working on is going to open a different workbook every time. I can't use VBA to write more VBA inside the workbook. Even if I could that would seem like a crazy solution

  7. #7
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: Save file so that next time it's opened Range A1 is active and in the window?

    Or you could use the 'before_save' event.....

  8. #8
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: Save file so that next time it's opened Range A1 is active and in the window?

    Ah I see. So....immediately after the workbook.open command can you just put a range("A1").select command?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. rogue window opens with any opened excel file
    By T 520 in forum Excel General
    Replies: 1
    Last Post: 05-23-2015, 09:58 AM
  2. [SOLVED] open a message window when excel file is opened with a function button
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-03-2013, 09:26 AM
  3. Replies: 2
    Last Post: 04-12-2013, 07:56 PM
  4. How to set a Global Macros so that it gets opened every time an excel file is opened?
    By pericopericone in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2013, 05:53 AM
  5. Excel 2007 : make Sheet1 active when file is opened
    By JennaL in forum Excel General
    Replies: 2
    Last Post: 05-06-2010, 10:41 PM

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