+ Reply to Thread
Results 1 to 10 of 10

Open file at specific cell dependant on value of another

  1. #1
    Registered User
    Join Date
    12-28-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    72

    Open file at specific cell dependant on value of another

    Hi Guys
    Sheet1 Cell A1 has Today() value populated
    Sheet2 Cell A1 to JO1 have dates from 01/01/2018 to 31/12/2018

    Id like the file to open on today's date (value = Sheet1 Cell A1), position = Sheet2 Row1

    Private Sub workbook_open()
    Application.Goto Worksheets("Sheet1").Range("a1")
    End Sub

    Gets the file to open the right worksheet, but how would you select the right cell, and how would this differ if you wanted the "goto cell" routine apart from the file open

    Thanks in advance

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Open file at specific cell dependant on value of another

    I think just selecting the cell you want will bring it into view.
    Please Login or Register  to view this content.
    If you want the cell to be the top left cell on the screen then
    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Open file at specific cell dependant on value of another

    Try this.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Registered User
    Join Date
    12-28-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    72

    Re: Open file at specific cell dependant on value of another

    Works a charm - Thank you so much Bakerman2. Not sure if I'm more impressed with the result itself or the speed you delivered it!

  5. #5
    Registered User
    Join Date
    12-28-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    72

    Re: Open file at specific cell dependant on value of another

    Thanks JLGWhiz - my example here was simplified, so in fairness I didn't convey the complexity of the requirements environment, but this is good to bear in mind too

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Open file at specific cell dependant on value of another

    Glad to help and thanks for feedback and rep+.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  7. #7
    Registered User
    Join Date
    12-28-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    72

    Re: Open file at specific cell dependant on value of another

    One more thing - how do I invoke a msg if the (todays) date isn't found
    Thanks in advance

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Open file at specific cell dependant on value of another

    Try this.
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    12-28-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    72

    Re: Open file at specific cell dependant on value of another

    Jackpot again Bakerman2 - thank you very much.

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Open file at specific cell dependant on value of another

    You're welcome and thanks for rep+.

+ 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. [SOLVED] Open/Load TEXT file with Specific Date and start at specific Cell
    By chergian in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-09-2017, 09:29 AM
  2. [SOLVED] Macro to open file with specific name from cell
    By sbehera in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-23-2013, 08:24 AM
  3. [SOLVED] Open specific folder, select file to open and copy then paste
    By Kranky in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-22-2012, 12:14 AM
  4. [SOLVED] How to set macro to open word file equal to cell contents of a specific cell
    By ligerdub in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-21-2012, 02:39 PM
  5. Hide specific columns dependant on number in specific cell
    By ladbroke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2012, 04:46 PM
  6. Open .TXT file Replace Specific Lines with Cell Values
    By Tellm in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-09-2011, 12:08 PM
  7. File open dependant on date
    By jamer02 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2011, 06:51 AM

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