Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-05-2021, 06:24 AM
MartyC MartyC is offline Please Help. Future date macro that updates automatically Windows 10 Please Help. Future date macro that updates automatically Office 2019
Novice
Please Help. Future date macro that updates automatically
 
Join Date: Aug 2021
Posts: 11
MartyC is on a distinguished road
Default Please Help. Future date macro that updates automatically

Hi All

New user here and complete noob to macros, so please forgive me if I don't have the right terminology.

I work for a homeless services organisation and we have a lot of men who stay with us each night. One of our partner organisations have to receive paperwork of us each day. ( why this has not went digital, i don't know )

Anyway, each day, the staff have to print out about 30 copes of this 7 page form, that has various fields, and the homeless guys details have to be hand written in etc and its very time consuming. There are also many different fields for todays date, and tomorrows date (indicating an overnight stay).

Unfortunately, we are told to use these forms by a parent organisation so we can't really simplify things as it is all templates.

However, I have figured out a way to make things faster to process and save a lot of writing, but I have an issue with just one thing, and this is where you lovely folk come in.

There is a section that asks for date of stay and date of departure. I can use the insert date and update automatically function, and that works fine. As for tomorrows date , I can find the macro that lets me insert todays date plus 1. Now when I opened one of the documents today to check, todays date was showing where it should, indicating the insert date and time function is working as it should, however, the macro didn't update automatically, to show tomorrows date, where its needed, and I'm wondering, can there be something added to the one I have, to make it update automatically also/ in other words, any time I open the document, it will always show tomorrows date where it should? The code I have is as follows...

Sub InsertFutureOrPastDate()
Dim strNumberOfDays As String

' Input the number of days you want to insert from today to the future or past date.
strNumberOfDays = InputBox("Please input the number of days you want to insert", "future or past date", "Input here.For exemple,input 1 to insert the date of tomorrow")


' Insert the future or past date according to the inputed number of days
If strNumberOfDays <> "" Then
Selection.TypeText Text:=Format(Date + strNumberOfDays, "dd/mm/yyyy")
End If
End Sub

Any help or advice would be great.

Thank you so much in advance...


Marty
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Preceding Day on Future Date.. ThorstenG Project 0 12-18-2017 06:14 AM
Please Help. Future date macro that updates automatically Date field - future date calculation + only business days neon4 Word 7 01-21-2016 02:21 PM
Please Help. Future date macro that updates automatically macro to automatically date sheet tab Jackie Excel Programming 13 05-24-2015 02:36 PM
Please Help. Future date macro that updates automatically VBA code for inserting a future date cosmopolitan Word VBA 1 08-14-2013 01:58 PM
Please Help. Future date macro that updates automatically Automatic date updates. WLVanS Word 12 01-29-2011 04:01 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:28 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft