Results 1 to 11 of 11

Exporting Workbook with new name

Threaded View

  1. #1
    Registered User
    Join Date
    11-10-2011
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    16

    Exporting Workbook with new name

    I'm currently working on a macro that export several rows and cells to a new workbook which then is saved as a txt-file with the same name as the original workbook.
    I have written and worked out everything except the saving-part. I can't work out how to save the new file with a different name everytime.

    Here's what i got so far:

    Sheets("Eksport").Visible = True
    Sheets("Eksport").Select
    ActiveSheet.Copy
    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs Filename:= "H:\My Documents\Ny Kalkuleringsmal\CSV\test.txt" _
        , FileFormat:=xlCSV, CreateBackup:=False
    Application.DisplayAlerts = False
    ActiveWorkbook.Close
    Sheets("Eksport").Visible = False
    Last edited by joehjas; 12-12-2011 at 08:07 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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