+ Reply to Thread
Results 1 to 9 of 9

Import File Name With Out Full Path Into Header

  1. #1
    Registered User
    Join Date
    10-26-2013
    Location
    Muncie, IN
    MS-Off Ver
    Excel 2010
    Posts
    17

    Import File Name With Out Full Path Into Header

    Hi All!

    So here is a challenging one that has had me going for a solid week and I can't seem to wrap my mind around it.

    So what I have is a simple spreed sheet with a macro, I click import to active a pop of file directory, to select file to import. That seems to all go fine but what I am struggling with is I need to import the name of the file as well into my header. Can this be done or is it pretty much hopeless.

    This is for my job site where we do trailer inspections, and I was hoping to cut the time we spend copying and pasting this information. I have attached my excel with macro (Trailer Inspections) and a mach up (YardHoundReport) of what the sheets look like that I am importing.

    Also if you know of a way to insert blacked out rows between the different parking areas that be sweet too, but it's no biggy.

    Thank You for any feedback you can give.
    Last edited by mkelsay91; 10-26-2013 at 10:31 AM.

  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: Import File Name With Out Full Path Into Header

    1) where in the master file does the file name go?
    2) When you run the macro it inserts an "Actual Temp" column F each time causing multiples to appear. That's not right is it? Shouldn't your master have all the columns already laid out and you copy the data from the source file into the correct columns that already exist? We can fix that.
    _________________
    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!)

  3. #3
    Registered User
    Join Date
    10-26-2013
    Location
    Muncie, IN
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Import File Name With Out Full Path Into Header

    Ooops! I goofed and add the one I was tampering with instead of the orginal. I have resubmitted the correct one labeled "Copy of Trailer Inspection.

    Apologize.
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Import File Name With Out Full Path Into Header

    Oops, you didn't answer any of my questions from post #2. Answer those, as well as :

    3) When you run this macro, doesn't it need to add to the bottom of the existing data already on this master?

  5. #5
    Registered User
    Join Date
    10-26-2013
    Location
    Muncie, IN
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Import File Name With Out Full Path Into Header

    The master should not have any date, except for what is listed at the top.

    What I am trying to accomplish is Importing the file name "YardHoundReport 10_23_13_-_11:23" into the header of the Master Copy.

    I was hoping there is a way to add something into my script so when I click Import and I get the File Browser, when I click on that file I am importing data from it pulls the file name as well into the Right Header.

    3) Its not intended for compiling data, it's a simply import and format set-up I was aiming for because I tend to prevent any saving.
    2) Due to nature of the way I have the import set up, the macro should insert a column and name it "Actual Temp".
    1) I believe I answered that at the start of the post of this.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Import File Name With Out Full Path Into Header

    Insert something like this where you'd like:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-26-2013
    Location
    Muncie, IN
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Import File Name With Out Full Path Into Header

    Doesn't seem to work, I keep getting error (800401a8).

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Import File Name With Out Full Path Into Header

    When you debug and hover your mouse over the highlighted code, what is the value of wkbSourceBook?

  9. #9
    Registered User
    Join Date
    10-26-2013
    Location
    Muncie, IN
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Import File Name With Out Full Path Into Header

    Range ("Z1").Value = Empty

    wkbSourceBook.Name = <Automation error>

    I am unsure which you wanted.

+ 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. Display a full file path name in a specific cell
    By David_S_Walker in forum Excel General
    Replies: 4
    Last Post: 01-06-2011, 10:53 AM
  2. Replies: 7
    Last Post: 10-09-2009, 10:10 AM
  3. Full File Path in footer in ALL workbooks
    By SBIProjEngineer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2008, 10:40 AM
  4. Opening a file with CommandButton without specifying full path
    By Glio in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2007, 02:33 PM
  5. [SOLVED] full path of excel file
    By Song in forum Excel General
    Replies: 2
    Last Post: 08-21-2005, 02:05 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