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
Bookmarks