+ Reply to Thread
Results 1 to 4 of 4

Save specific sheet as CSV file prompting for a file name

  1. #1
    Registered User
    Join Date
    06-28-2018
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    4

    Save specific sheet as CSV file prompting for a file name

    Hi All
    I have a code to save a specific sheet (Catan CSV) as a CSV file which over writes the same file every time. I need the code to prompt for a file name to be entered to save the Catan CSV sheet as, under the existing folder in the below code.
    -----------------------------
    Option Explicit

    Public Sub ExportWorksheetAndSaveAsCSV()

    Dim wbkExport As Workbook
    Dim shtToExport As Worksheet

    Set shtToExport = ThisWorkbook.Worksheets("Catan CSV")
    Set wbkExport = Application.Workbooks.Add
    shtToExport.Copy Before:=wbkExport.Worksheets(wbkExport.Worksheets.Count)
    Application.DisplayAlerts = False
    wbkExport.SaveAs Filename:="\\etwbms01\homes$\spope\My Documents\CVS Files\Roames Catan CSV.csv", FileFormat:=xlCSV
    Application.DisplayAlerts = True
    wbkExport.Close SaveChanges:=False

    End Sub

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

    Re: Save specific sheet as CSV file prompting for a file name

    Please Login or Register  to view this content.
    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
    Registered User
    Join Date
    06-28-2018
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    4

    Re: Save specific sheet as CSV file prompting for a file name

    That is awesome AlphaFrog
    Exactly what I required
    Thanks

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

    Re: Save specific sheet as CSV file prompting for a file name

    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. [SOLVED] Prompting path to save the file
    By Ravana in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-07-2015, 11:02 AM
  2. [SOLVED] How do I close a workbook without prompting to save file?
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-12-2014, 06:31 AM
  3. [SOLVED] How do I close a workbook without prompting to save file?
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-05-2014, 06:31 PM
  4. Export word file prompting a dialog box save location
    By Fossilized in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-05-2011, 03:04 AM
  5. [SOLVED] File closes without prompting to save
    By freyabeads in forum Excel General
    Replies: 0
    Last Post: 03-01-2006, 09:10 AM
  6. calculation - prompting to save when file closes
    By lpj in forum Excel General
    Replies: 0
    Last Post: 02-14-2006, 04:30 PM
  7. [SOLVED] [SOLVED] Close Excel file without prompting user to save
    By JDay01 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-10-2005, 05:06 PM

Tags for this Thread

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