Spreadsheet save using a macro
Norman,
I hate to be dense, but I am in a time crunch here and need further
information, if you don't mind.
I am not familiar with VBscripting and I am having trouble recording a macro
to save one specific worksheet out of a workbook.
I found this post, but do not know what to substitute for
Application.DefaultFilePath...I think I know the values I need to replace for
the rest.
Can you help me or guide me to more information about writing macros?
Thanks,
--
Jean
"Norman Jones" wrote:
Hi KM,
Try something like:
'===================
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim aCell As Range
Dim sPath As String
sPath = Application.DefaultFilePath '<<======== CHANGE
Set WB = ActiveWorkbook '<<======== CHANGE
Set SH = WB.Sheets("Sheet1") '<<======== CHANGE
Set aCell = SH.Range("Invoice_Number") '<<======== CHANGE
WB.SaveAs CStr(aCell.Value) & ".xls", FileFormat:=xlNormal
End Sub
'<<===================
---
Regards,
Norman
"kmdaly" wrote in message
...
I created a macro to save a spreadsheet from a template. I want to use the
cell "invoice number" as the name when doing the save. I have not been
able
to figure out how to tell the macro to use a specific cell for a name
save.
|