Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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:P").Select Selection.ColumnWidth = 15 Columns("B:O").Select Selection.Style = "Currency" myFileName = ThisWorkbook.Worksheets("Sheet99").Range("a99").Va lue _ & "--" & 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. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |