+ Reply to Thread
Results 1 to 7 of 7

paste source filepath information to destination book (code included)

  1. #1
    Forum Contributor
    Join Date
    02-05-2014
    Location
    Bay Area
    MS-Off Ver
    Excel 2010
    Posts
    164

    paste source filepath information to destination book (code included)

    I have a workbook with the following code. The backdrop is that I have another VBA code that prompts the user to select a raw data source file (all in one folder) to upload to the destination book. Once uploaded the destination book runs macros to calculate the data. This piece works great. However, my problem lies in the code below (brand new code, to me). This code is supposed to paste the file name (into "AI1) and date/time last modified (into "AJ1") from the specific source sheet selected by the user, into the sheet where the raw data is uploaded in the destination book. What the code below is doing is pasting the file name and date/time modified information (great) for ALL of the files in my "Data Source" folder. By the way, I'm a VBA novice. I cannot figure out how to have this code paste these two pieces of information (FILE NAME and DATE/TIME MODIFIED) for only the file selected for upload into the destination. Any clues? Thank you.

    Filepath copy/paste code (pastes all files in the folder -- not desired)
    Please Login or Register  to view this content.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: paste source filepath information to destination book (code included)

    You only want the name an last modified date for one file? A file chosen by the user?

    The code above doesn't copy any information across workbooks.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Contributor
    Join Date
    02-05-2014
    Location
    Bay Area
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: paste source filepath information to destination book (code included)

    Hi Solus.
    Yes to both questions. I want the name and last modified date for one file -- a file that will be selected from a single folder by the user. However, the name and last modified date could be placed on the source file, after which I will simply pull it from those two cells (e.g., A1 = file name / A2 = last modified). And, yes, I'm out of my league on this piece of code. I thought this would be more common than it appears to be.
    Thank you very much for thinking through my challenge.
    Regards, Jeff

  4. #4
    Forum Contributor
    Join Date
    02-05-2014
    Location
    Bay Area
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: paste source filepath information to destination book (code included)

    By the way, what I'm using now is the following code; however, that gives me the date/time that the data was uploaded into the destination sheet. I'm pasting this upload date/time to the source sheet and then pulling it into the destination. That sequence works fine for me; however, I need the date/time modified info, rather than the upload info. Thanks again.

  5. #5
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: paste source filepath information to destination book (code included)

    This will get you the info. I'm still not sure I understand how you want to use it.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    02-05-2014
    Location
    Bay Area
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: paste source filepath information to destination book (code included)

    This is a much better solution, Solus! It's tight and it works. Thank you so much. It's greatly appreciated. Have a nice day.

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: paste source filepath information to destination book (code included)

    Glad to help.

    If you are satisfied with the solution please mark the thread as [SOLVED] using the thread tools at the top.

    And on any thread you can show your appreciation to those who have helped you by clicking the * below their post.

+ 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] Date/Time stamp:inserting the source book date & time into the destination book
    By macrorookie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-24-2014, 06:48 PM
  2. VBA Copy Paste Cuts From Source, Sends to Ether - Not To Destination Workbook
    By jcaynes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2014, 11:05 AM
  3. Replies: 3
    Last Post: 08-07-2013, 10:16 AM
  4. Get data from source workbook and paste to destination in change format
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2012, 01:47 AM
  5. Replies: 2
    Last Post: 01-22-2011, 01:24 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