+ Reply to Thread
Results 1 to 12 of 12

my saveas macro date problem

Hybrid View

  1. #1
    Nigel
    Guest

    my saveas macro date problem

    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

  2. #2
    Jim Rech
    Guest

    Re: my saveas macro date problem

    I could see nothing in your code that would affect your computer's date or
    time setting but I ran your code anyway to confirm it. I'm sorry it runs
    fine for me and my computer is unaffected.

    --
    Jim
    "Nigel" <Nigel@discussions.microsoft.com> wrote in message
    news:C2904EEA-8CDB-4421-9D85-C033B4B71BB1@microsoft.com...
    > 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




  3. #3
    Vacation's Over
    Guest

    RE: my saveas macro date problem

    check all sheets and modules for some "code remnants"
    as a newbie You may have other code in "thisworkbook events" by mistake

    test by cut and paste to new workbook and see if code works like it did for
    Jim.

    "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


  4. #4
    Norman Jones
    Guest

    Re: my saveas macro date problem

    Hi Nigel,

    Is there any chance that the Dater variable has inadvertently been
    reproduced as Date somewhere in your code?

    If the code icludes, for example, something like:

    Date = Range("B32").Value

    then the system date would be changed if the value of B32 was other than
    the system date. Additionally, depending on the value o f B32, your time
    might be adjusted by 1 (2?) hours to allow for local ime changes.


    ---
    Regards,
    Norman



    "Nigel" <Nigel@discussions.microsoft.com> wrote in message
    news:C2904EEA-8CDB-4421-9D85-C033B4B71BB1@microsoft.com...
    > 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




  5. #5
    Norman Jones
    Guest

    Re: my saveas macro date problem

    Hi Neil,

    Fogive the date/time stamp on my previous post.

    I tested my assertion and, omitting to restore the correct values, was hoist
    by my own petard!

    ---
    Regards,
    Norman



    "Norman Jones" <normanjones@whereforartthou.com> wrote in message
    news:OTL93H0nFHA.1204@tk2msftngp13.phx.gbl...
    > Hi Nigel,
    >
    > Is there any chance that the Dater variable has inadvertently been
    > reproduced as Date somewhere in your code?
    >
    > If the code icludes, for example, something like:
    >
    > Date = Range("B32").Value
    >
    > then the system date would be changed if the value of B32 was other than
    > the system date. Additionally, depending on the value o f B32, your time
    > might be adjusted by 1 (2?) hours to allow for local ime changes.
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Nigel" <Nigel@discussions.microsoft.com> wrote in message
    > news:C2904EEA-8CDB-4421-9D85-C033B4B71BB1@microsoft.com...
    >> 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

    >
    >




  6. #6
    Don Guillett
    Guest

    Re: my saveas macro date problem

    Norman, Please change your date

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "Norman Jones" <normanjones@whereforartthou.com> wrote in message
    news:OTL93H0nFHA.1204@tk2msftngp13.phx.gbl...
    > Hi Nigel,
    >
    > Is there any chance that the Dater variable has inadvertently been
    > reproduced as Date somewhere in your code?
    >
    > If the code icludes, for example, something like:
    >
    > Date = Range("B32").Value
    >
    > then the system date would be changed if the value of B32 was other than
    > the system date. Additionally, depending on the value o f B32, your time
    > might be adjusted by 1 (2?) hours to allow for local ime changes.
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Nigel" <Nigel@discussions.microsoft.com> wrote in message
    > news:C2904EEA-8CDB-4421-9D85-C033B4B71BB1@microsoft.com...
    > > 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

    >
    >




  7. #7
    Norman Jones
    Guest

    Re: my saveas macro date problem

    Hi Don,

    See my apology and explanation posted 5 weeks ago!



    ---
    Regards,
    Norman



    "Don Guillett" <donaldb@281.com> wrote in message
    news:ercRSZuuFHA.2880@TK2MSFTNGP12.phx.gbl...
    > Norman, Please change your date
    >
    > --
    > Don Guillett
    > SalesAid Software
    > donaldb@281.com
    > "Norman Jones" <normanjones@whereforartthou.com> wrote in message
    > news:OTL93H0nFHA.1204@tk2msftngp13.phx.gbl...
    >> Hi Nigel,
    >>
    >> Is there any chance that the Dater variable has inadvertently been
    >> reproduced as Date somewhere in your code?
    >>
    >> If the code icludes, for example, something like:
    >>
    >> Date = Range("B32").Value
    >>
    >> then the system date would be changed if the value of B32 was other than
    >> the system date. Additionally, depending on the value o f B32, your time
    >> might be adjusted by 1 (2?) hours to allow for local ime changes.
    >>
    >>
    >> ---
    >> Regards,
    >> Norman
    >>
    >>
    >>
    >> "Nigel" <Nigel@discussions.microsoft.com> wrote in message
    >> news:C2904EEA-8CDB-4421-9D85-C033B4B71BB1@microsoft.com...
    >> > 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

    >>
    >>

    >
    >




  8. #8
    Dave Peterson
    Guest

    Re: my saveas macro date problem

    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

  9. #9
    Nigel
    Guest

    Re: 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
    >


  10. #10
    Dave Peterson
    Guest

    Re: my saveas macro date problem

    That line isn't the culprit. But maybe you used "datestr" in another line that
    did cause the error.

    (I'd keep looking.)

    Nigel wrote:
    >
    > 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
    > >


    --

    Dave Peterson

  11. #11
    Nigel
    Guest

    Re: my saveas macro date problem

    Hi Dave,

    i looked all over my personal macro book and i found
    date = range("H18").value

    this was for another workbook but it was currently open when i initially
    started my macro for the new book. i have now rectified it just in case.

    Kind regards,

    Nigel

    "Dave Peterson" wrote:

    > That line isn't the culprit. But maybe you used "datestr" in another line that
    > did cause the error.
    >
    > (I'd keep looking.)
    >
    > Nigel wrote:
    > >
    > > 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
    > > >

    >
    > --
    >
    > Dave Peterson
    >


  12. #12
    Dave Peterson
    Guest

    Re: my saveas macro date problem

    Glad you found it.

    Nigel wrote:
    >
    > Hi Dave,
    >
    > i looked all over my personal macro book and i found
    > date = range("H18").value
    >
    > this was for another workbook but it was currently open when i initially
    > started my macro for the new book. i have now rectified it just in case.
    >
    > Kind regards,
    >
    > Nigel
    >
    > "Dave Peterson" wrote:
    >
    > > That line isn't the culprit. But maybe you used "datestr" in another line that
    > > did cause the error.
    > >
    > > (I'd keep looking.)
    > >
    > > Nigel wrote:
    > > >
    > > > 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
    > > > >

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1