+ Reply to Thread
Results 1 to 2 of 2

Cell Contents to identify source Filename

  1. #1
    Registered User
    Join Date
    01-31-2006
    Location
    Washington State
    Posts
    10

    Question Cell Contents to identify source Filename

    Hi, all

    I'm trying to build a macro that will allow users to input file locations, I'm having a hard time getting the macro to substitute cell contents for a hard-coded string. I have this:

    Workbooks.OpenText Filename:= _
    "S:\Departments\Shop Public\Support\stats_liste_MvtStock.txt" _

    I would like to instead have something like this:

    Workbooks.OpenText Filename:= _
    "cell(D6)" _

    In this case D6 would contain the file address on the network. With that accomplished, users can identify their source files without rooting around in the code. This can't be too hard, can it?

    Thanks,

    Nate

  2. #2
    Chip Pearson
    Guest

    Re: Cell Contents to identify source Filename

    Try

    Workbooks.OpenText
    Filename:=Worksheets("Sheet1").Range("D6").Value



    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "ThalesNate"
    <[email protected]> wrote
    in message
    news:[email protected]...
    >
    > Hi, all
    >
    > I'm trying to build a macro that will allow users to input file
    > locations, I'm having a hard time getting the macro to
    > substitute cell
    > contents for a hard-coded string. I have this:
    >
    > Workbooks.OpenText Filename:= _
    > "S:\Departments\Shop Public\Support\stats_liste_MvtStock.txt"
    > _
    >
    > I would like to instead have something like this:
    >
    > Workbooks.OpenText Filename:= _
    > "cell(D6)" _
    >
    > In this case D6 would contain the file address on the network.
    > With
    > that accomplished, users can identify their source files
    > without
    > rooting around in the code. This can't be too hard, can it?
    >
    > Thanks,
    >
    > Nate
    >
    >
    > --
    > ThalesNate
    > ------------------------------------------------------------------------
    > ThalesNate's Profile:
    > http://www.excelforum.com/member.php...o&userid=31037
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=549610
    >




+ 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