If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Date macro
Hi,
I have a form for scheduling conference rooms and would like to have a macro that would create a unique date at the top of this form for every day of the year with the day of the week first, followed by the day (e.g, Wednesday, May 26, 2004). I would like the option to start with any date I wanted to and print for as many days as I wanted to (e.g., start with January 1 for 180 days or start with November 4 for 30 days, etc.). Of course, I am perfectly willing to change these parameters manually within the macro if necessary (to simplify the code). In addition, I would like it to skip Saturday and Sunday. Anyone have something like this? |
#2
|
|||
|
|||
Date macro
An easy approach would be to set up a mail merge using an Excel spreadsheet
as the data source. It's easy to create lists of dates in any desired format in Excel. In this case, you would enter the Monday through Friday, then the next Monday (to show Excel you want to skip weekends), then drag to AutoFill. If necessary, Format | Cells to apply the desired date formatting. To create the mail merge, select the desired records (dates) and Merge to New Document. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Lana" wrote in message ... Hi, I have a form for scheduling conference rooms and would like to have a macro that would create a unique date at the top of this form for every day of the year with the day of the week first, followed by the day (e.g, Wednesday, May 26, 2004). I would like the option to start with any date I wanted to and print for as many days as I wanted to (e.g., start with January 1 for 180 days or start with November 4 for 30 days, etc.). Of course, I am perfectly willing to change these parameters manually within the macro if necessary (to simplify the code). In addition, I would like it to skip Saturday and Sunday. Anyone have something like this? |
#3
|
|||
|
|||
Date macro
Thank you Suzanne, I'll try that on Monday and let you know how it works.
Lana |
#4
|
|||
|
|||
Date macro
Hi Suzanne,
Thanks for the tip. Didn't work like I expected, but using the Day of Week in 1 column and the Date in another, then using the fill feature with the Weekdays option I was able to generate a spread sheet datasource. Then the mailmerge from Word worked just fine. Simple solution to a complex coding problem. Thank you again. Lana |
#5
|
|||
|
|||
Date macro
Glad you got it figured out given the exiguous and faulty lead I gave you!
-- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Lana" wrote in message news Hi Suzanne, Thanks for the tip. Didn't work like I expected, but using the Day of Week in 1 column and the Date in another, then using the fill feature with the Weekdays option I was able to generate a spread sheet datasource. Then the mailmerge from Word worked just fine. Simple solution to a complex coding problem. Thank you again. Lana |
Thread Tools | |
Display Modes | |
|
|