Excel Variable Save Name problem

  • Thread starter Thread starter Lippa73
  • Start date Start date
L

Lippa73

I have written a program for work that is basically a daily cash u
spreadsheet, however I would like to save each days report as a backup


Ideally I would like to save the worksheet as that days date by us
of a command button/macro to reduce the chance of user erro( ie savin
under wrong name) The date is on the worksheet, but I can't figure ou
a way to use a range as a save name.

I would really appreciate some help with this problem. Cheer
 
Hi Lippa73

One way to save a copy in C:\ with a date/time stamp

Sub test()
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
With ThisWorkbook
.SaveCopyAs "C:\Copy of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
End With
End Sub
 
ActiveWorkbook.SaveCopyAs "C:\MyDir\ & _ Format(Range("A1"),"yyyy/mm/dd")
& _ - Cash Up.xls"-- HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Got screwed up a bit

ActiveWorkbook.SaveCopyAs "C:\MyDir\ & _
Format(Range("A1"),"yyyy/mm/dd") & _
"- Cash Up.xls"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Bob Phillips said:
ActiveWorkbook.SaveCopyAs "C:\MyDir\ & _ Format(Range("A1"),"yyyy/mm/dd")
& _ - Cash Up.xls"-- HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Also shouldn't put / in there

ActiveWorkbook.SaveCopyAs "C:\MyDir\ & _
Format(Range("A1"),"yyyy-mm-dd") & _
"- Cash Up.xls"


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Bob Phillips said:
Got screwed up a bit

ActiveWorkbook.SaveCopyAs "C:\MyDir\ & _
Format(Range("A1"),"yyyy/mm/dd") & _
"- Cash Up.xls"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top