+ Reply to Thread
Results 1 to 6 of 6

VB to use data from spreadsheet and input box to create new folder and text file

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    VB to use data from spreadsheet and input box to create new folder and text file

    I am trying to write a VB that will use the data from an exsiting excel spreadsheet to create a new folder in a specific location (using an input prompt) and create a text file (using specific data on the spreadsheet and from the input prompt). Attached are an example of the spreadsheet and the desired output, and below is an attempt at a VB. Am I close to getting this to work? Thank you .

    VB
    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VB to use data from spreadsheet and input box to create new folder and text file

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 08-19-2015 at 04:33 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: VB to use data from spreadsheet and input box to create new folder and text file

    works great, what is the correct syntax for CDate + 1 so in the "please enter scan date" is 8-20-2015

    Also when the folder is created currently it is 25512_42235 (the date in the input box is 8/19/2015, the text is bold is that). Thank you .

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VB to use data from spreadsheet and input box to create new folder and text file

    ("Please enter scan date", "Scan Date", Date + 1, Type:=2)

    What date format do you want for the folder name; It cannot be m/d/yyyy ?


    I had later edited the mydirectory to this which you may not have gotten.

    MyDirectory = "N:\1_DATA\MicroArray\NexusData\" & MyBarCode & "_" & Format(CDate(MyScan), "m_d_yyyy") & "\"
    Last edited by AlphaFrog; 08-19-2015 at 04:59 PM.

  5. #5
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: VB to use data from spreadsheet and input box to create new folder and text file

    Perfect, works great..... thank you very much .

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VB to use data from spreadsheet and input box to create new folder and text file

    You're welcome. Thanks for the feedback.

+ 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. how to create a button that print out a file that data matched the input window
    By nan342 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2013, 04:20 PM
  2. [SOLVED] Macro to copy file names and data from each file in a folder into master spreadsheet
    By dee1989 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-10-2012, 05:52 AM
  3. Replies: 3
    Last Post: 09-30-2011, 04:35 AM
  4. Save a file to a folder, create folder if it doesn't exist
    By mcinnes01 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-01-2010, 09:12 AM
  5. Create Folder with system date then save file to folder
    By cartotech81 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2009, 02:12 PM
  6. How to input data from a text file?
    By jp001 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2009, 10:23 AM
  7. Replies: 6
    Last Post: 08-11-2006, 03:41 PM
  8. Import text file and create new spreadsheet
    By demianill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2006, 02:25 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