+ Reply to Thread
Results 1 to 2 of 2

Using variables to import csv files

  1. #1
    Registered User
    Join Date
    08-14-2012
    Location
    Edmonton
    MS-Off Ver
    Excel 2013
    Posts
    17

    Using variables to import csv files

    I have used this macro to open CSV files based on the content of a cell. (Cell C24 in workbook "ELO")
    These files are just a number. (eg 20001.csv)
    I have files 20001.csv to 21230.csv in directory C:\NHL\GetPbP\TOI2013\

    I run a macro to increase the value of c24 each time it is run
    20001, then 20002 etc which will then import that file.
    This all works fine and dandy!

    Please Login or Register  to view this content.
    Now I need to import csv files that are a mix of number and text.
    (eg "20001 shifts.csv")

    Now the "shifts" text is fixed...all files have this text, the only variable is the number which is located in cell "N2"

    Can you help me import the files I need?

    I run a macro that will change the value in cell "N2" and I wish to import the CSV file based on that file name. 20001 shifts.csv, then 20002 shifts.csv etc

    Thanks

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Using variables to import csv files

    Hi,

    Change your first 2 lines code above with this :

    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

+ 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] Macro to Import Multiple TXT Files into workbook - User to select files/directory
    By saber007 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-15-2013, 08:43 PM
  2. Import CSV file using variables
    By Trent_Illician in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2012, 03:49 PM
  3. Noob 4 Help - Macro to LIST ALL FILES IN FOLDER and then IMPORT ALL LISTED FILES
    By StlSmiln in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-25-2012, 04:02 AM
  4. [SOLVED] Can i import .csv files into Outlook as sep files
    By joe41 in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 03-25-2009, 04:39 AM
  5. Replies: 5
    Last Post: 11-22-2005, 02:10 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