+ Reply to Thread
Results 1 to 5 of 5

Create CSV w/ variable name

  1. #1
    Forum Contributor
    Join Date
    10-08-2013
    Location
    End of the World, USA
    MS-Off Ver
    EXCEL 2007
    Posts
    111

    Create CSV w/ variable name

    How do I generate a csv file from one sheet with a name that has an ending number that goes up if the file with that number already exists?

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Create CSV w/ variable name


    With Dir function you can check if the file already exists …

  3. #3
    Forum Contributor
    Join Date
    10-08-2013
    Location
    End of the World, USA
    MS-Off Ver
    EXCEL 2007
    Posts
    111

    Re: Create CSV w/ variable name

    and then? do I just add Dir somewhere and it will change the name?

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Create CSV w/ variable name


    Hey, it's just pure logic !

    If the file exists, you must increment the ending number …

  5. #5
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: Create CSV w/ variable name

    Put these macros in a module, then get the filename by: vFile = getSaveFile(originalFileName)


    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    10-08-2013
    Location
    End of the World, USA
    MS-Off Ver
    EXCEL 2007
    Posts
    111

    Re: Create CSV w/ variable name

    one thing, I'm only familiar with subs, how do I integrate this into a sub?, where does it ask which sheet to use from the workbook?
    Last edited by frank35; 07-11-2014 at 09:41 AM.

+ 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] Create a variable with a dynamic name
    By Dralky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2013, 12:34 AM
  2. variable in to input data into variable named sheet and if does not exist create
    By rwhidden in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-30-2011, 12:08 AM
  3. Using a Variable in vba SQL to create a table
    By Dave31 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-30-2008, 09:46 AM
  4. Using an ampersand to create a variable
    By AndySuk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2007, 08:32 AM
  5. [SOLVED] how to create a three variable chart.
    By [email protected] in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-23-2006, 07:35 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