![]() |
#1
|
|||
|
|||
![]()
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 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Preceding Day on Future Date.. | ThorstenG | Project | 0 | 12-18-2017 06:14 AM |
![]() |
neon4 | Word | 7 | 01-21-2016 02:21 PM |
![]() |
Jackie | Excel Programming | 13 | 05-24-2015 02:36 PM |
![]() |
cosmopolitan | Word VBA | 1 | 08-14-2013 01:58 PM |
![]() |
WLVanS | Word | 12 | 01-29-2011 04:01 AM |