how to create a macro to save as a file with yesterday's date. RRS feed

  • Question

  • I am very green when it comes to VBA but I am trying to create a macro that will save a report with yesterdays date in the title to a specific folder. I'm sure there is a way of doing this but not sure what the protocol is in doing so. if someone could help me with this I would greatly appreciate it!!
    Wednesday, July 13, 2016 2:15 PM

All replies

  • You can get timestamp of yesterday's date like this.  Just prepend it to the name.  You can change the format.  I usually use this format.

    stamp = Format(DateAdd("d", -1, Date), "yymmdd")

    Wednesday, July 13, 2016 4:16 PM