+ Reply to Thread
Results 1 to 2 of 2

grabbing cell content as a file path for VBA

  1. #1
    Registered User
    Join Date
    08-09-2011
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    2

    grabbing cell content as a file path for VBA

    Hi all,

    Had a quick look and couldn't find anything like this that has been answered already.

    I would like to do the following.

    Background.

    We have approx 30 technical claims handlers who each use a spreadsheet to record their individual caseloads with various dates etc. All these spreadsheets live in a communual folder on a network drive.
    To assist the team manager I want to build something that will analyse each persons data for purposes of monthly 1 to 1's etc. That in itself is a doddle.
    Due to Head Office and their silly rules I cannot do the obvious and add a worksheet in (don't even go into the why and why nots) so I plan on a standalone spreadsheet to copy across an individuals data and work things out there. (Again a doddle)
    The team managers are not exactly excel savvy, so the idea is to automate as much as possibly using VBA and macro. What I plan is a dropdown box - they select the persons name, click a button and hey presto it all happens. (99% of that I can do)

    The problem

    I envisage a vlookup off the name in the dropdown box, the second column would contain the filepath and filename of that persons spreadsheet. So if I picked Josh I would get s:\filepath\josh.xls

    What I don't know how to do in VBA is to say "take the contents of cell C1, and use that as the name of the spreadsheet to open

    e.g. Workbooks.Open Filename:="S:\filepath\josh.xls."

    what code do i put in so it reads C1 as the link and puts it in.


    I hope that makes some kind of sense.


    It is going to be as simple as

    Workbooks.Open Filename:= cells(1,3).value ?






    Many thanks in advance

  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: grabbing cell content as a file path for VBA

    Yes, your syntax is good, and if you test these commands you'll see which ones work or not. Best to give some idea where this cell is found, too.

    Please Login or Register  to view this content.
    _________________
    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!)

+ 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