G
Gene Augustin
MAC Powerbook G4, OS 10.5.6
Office 2004, Excel 2004 Version 11.5.3
I do a lot of manipulation with a macro in a workbook and end up with
several sheets and I save using the macro. So-far, so-good.
After the save, I activate a certain worksheet,
shtold.Activate
Where shtold is the name of the worksheet Sheets("QIF")
This name changes from time to time.
Then, SAVE AS a csv in the same folder as the original and reopen the
original
This all works except
1 I don't know how to format Filename with the name the variable name of
the worksheet with the date the current date in "mm-dd-yy" format appended.
Perhaps some type of MsgBox or FormBox to input the name, but that would
require user intervention.
2 The format is wrong to reopen the original
The lines below without a comment work.
Dim shtnew As Worksheet, shtold As Worksheet, bookname As Workbook
ActiveWorkbook.Save
bookname = ActiveWorkbook.Name
shtold.Activate
ActiveWorkbook.SaveAs FileFormat:=xlCSV, Filename:="QIF-CSV" 'need to change
Filename
ActiveWorkbook.Close SaveChanges:=False
Workbooks.Open.Name = bookname " 'wrong format
End Sub
Office 2004, Excel 2004 Version 11.5.3
I do a lot of manipulation with a macro in a workbook and end up with
several sheets and I save using the macro. So-far, so-good.
After the save, I activate a certain worksheet,
shtold.Activate
Where shtold is the name of the worksheet Sheets("QIF")
This name changes from time to time.
Then, SAVE AS a csv in the same folder as the original and reopen the
original
This all works except
1 I don't know how to format Filename with the name the variable name of
the worksheet with the date the current date in "mm-dd-yy" format appended.
Perhaps some type of MsgBox or FormBox to input the name, but that would
require user intervention.
2 The format is wrong to reopen the original
The lines below without a comment work.
Dim shtnew As Worksheet, shtold As Worksheet, bookname As Workbook
ActiveWorkbook.Save
bookname = ActiveWorkbook.Name
shtold.Activate
ActiveWorkbook.SaveAs FileFormat:=xlCSV, Filename:="QIF-CSV" 'need to change
Filename
ActiveWorkbook.Close SaveChanges:=False
Workbooks.Open.Name = bookname " 'wrong format
End Sub