G
Guest
I want to program a macro that will format a CSV file and then save it as a
..xls file with the same name (but not the same file extension)
I have tried to get this macro to work but I'm a newbie with macros. Can
someone debug it for me? Thanks in advance.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 11/20/2005 by CPertel
'
' Keyboard Shortcut: Ctrl+q
'
Dim myFileName As String
Columns("A
").Select
Selection.ColumnWidth = 15
Columns("B:O").Select
Selection.Style = "Currency"
myFileName = ThisWorkbook.Worksheets("Sheet99").Range("a99").Value _
& "--" & Format(Now, "yyyy_mm_dd__hh_mm_ss") & ".xls"
ThisWorkbook.SaveAs Filename:=myFileName
End Sub
Have no idea why the Sheet99 (I have one sheet for each workbook) and what
the range a99 means. Also don't know whether the long myFileName statement
needs to be on one line or can be "folded" into two.
..xls file with the same name (but not the same file extension)
I have tried to get this macro to work but I'm a newbie with macros. Can
someone debug it for me? Thanks in advance.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 11/20/2005 by CPertel
'
' Keyboard Shortcut: Ctrl+q
'
Dim myFileName As String
Columns("A

Selection.ColumnWidth = 15
Columns("B:O").Select
Selection.Style = "Currency"
myFileName = ThisWorkbook.Worksheets("Sheet99").Range("a99").Value _
& "--" & Format(Now, "yyyy_mm_dd__hh_mm_ss") & ".xls"
ThisWorkbook.SaveAs Filename:=myFileName
End Sub
Have no idea why the Sheet99 (I have one sheet for each workbook) and what
the range a99 means. Also don't know whether the long myFileName statement
needs to be on one line or can be "folded" into two.