View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default using macro to save worksheet with unique file name

Hi Noell

You can use the date and time as a part of the filename

Sub Test()
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Set wb = ActiveWorkbook
With wb
.SaveAs Sheets("Sheet1").Range("A1").Value _
& " " & strdate & ".xls"
'wb.Close False
End With
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Noell" wrote in message ...
I am trying to write a macro to save a worksheet with a
unique file name, preferably using a cell value, every
time the macro is used. Can anyone help me?