my saveas macro date problem
Hi Dave,
i checked my macro pages and........ underneath this macro was another one
which had the line
datestr = activesheet.range("h16").value
could this be the illusive culprit?? i have removed it now and it is working
fine. the date stays the same and time doesnt change. for a safeguard, i have
now changed my "dater" to a nother word for less pc confusion.
thanks for adice everyone :)
nigel
"Dave Peterson" wrote:
I don't think it's caused by the code you've posted.
But if you have a line like this:
date = ActiveSheet.Range("h16").Value
you could be changing the system date.
And your variable Dater is pretty close to Date.
I'd check for typos.
Nigel wrote:
Hi,
i have a now written a macro with help from this site ( thanks everyone )
that saves my active sheet as a separate workbook in a location based on
information entered on the sheet. ( a folder on the server with monthly
folders inside ).my problem is now this. the macro looks at the date required
for the invoice to determine where this sheet will be saved. ( we also post
invoice and pend them for the next month so we enter a forcasted month and
save it automatically to the month folder). but if i enter a forcasted date
that is in front of todays date, the macro changes the computer date to that
date entered on the invoice and puts the time back by 2 hours. Does nanybody
have any ideas???
here is my macro:
Sub saveassheet()
Namer = ActiveSheet.Name
Location = "S:\Invoicing & Sales\Invoices April 05 - March 06"
yearly = Format(ActiveSheet.Range("h16").Value, "yy")
Dater = Format(ActiveSheet.Range("h16").Value, "mmmm")
Clienter = Range("B23").Value
detailer = Range("B32").Value
ActiveSheet.Copy
ActiveWorkbook.SaveAs Location & "\" & Dater & " " & yearly & "\" & Namer &
" " & Clienter & " " & detailer
End Sub
This is causing me huge confusion.
thanks in advance,
Nigel
--
Dave Peterson
|