+ Reply to Thread
Results 1 to 5 of 5

Open a workbook from cell reference

  1. #1
    Registered User
    Join Date
    07-07-2008
    Location
    Bath
    MS-Off Ver
    Microsoft Office 2007
    Posts
    42

    Open a workbook from cell reference

    Hi,

    I have searched the internet for more then one hour to find an answer to my question, but sadly I couldn't find it ... So here it is:

    I have two documents (.xls and .csv). They are going to be always in one folder, BUT different location. For this I have looked up the following code, what works just fine:

    Function mPath() As String
    mPath = ThisWorkbook.Path
    End Function
    Then if I type into any cell the =mpath() function it will give me the location of my document. My problem starts here ... I don't know how I could include a code into my Macro so it will reference to that cells address.

    I hope it's understandable what's I'm trying to achieve ... If not then I'll give it another try.

    Thanks,
    George

  2. #2
    Registered User
    Join Date
    06-12-2008
    Location
    Newbury
    MS-Off Ver
    Office 365 ProPlus
    Posts
    92
    Try:

    Please Login or Register  to view this content.
    This will return the cell reference as a string in the format "$A$1"

    Use:

    Please Login or Register  to view this content.
    If you want the cell reference returned as "A1"

  3. #3
    Registered User
    Join Date
    07-07-2008
    Location
    Bath
    MS-Off Ver
    Microsoft Office 2007
    Posts
    42

    Post

    Hi chergh,

    Thanks for the quick reply.

    I couldn' use the code what you gave me. Maybe I have just explained it really badly and comlicated. I'll try it once again ...

    I have two documents in a folder. i.e. a.xls and b.csv. I have to update weekly the b.csv. I made a few macros in a.xls what would copy everything over from b.csv and the distribute the date over the tabs. This works fine. The problem is that I might have to send this document to my colleagues and in a.xls the path to b.csv is always the same ( c:mydocument/desktop/project/b.csv) and it won't work on his PC. What would be great to have a macro what would always point to that directory in which the file has been saved/ moved.

    Thanks for the help.

    Regards,
    George

  4. #4
    Registered User
    Join Date
    07-07-2008
    Location
    Bath
    MS-Off Ver
    Microsoft Office 2007
    Posts
    42
    Hi,

    Any ideas comments?!

    Thanks,
    George

  5. #5
    Registered User
    Join Date
    07-07-2008
    Location
    Bath
    MS-Off Ver
    Microsoft Office 2007
    Posts
    42
    Please let me know if it's not understandable what I want to say.

    thanks,
    George

+ 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