Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-08-2011, 03:42 AM
OTPM OTPM is offline Code to add dates Windows 7 32bit Code to add dates Office 2010 32bit
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi Terri
Can you post a copy of your workbook containing the code and we can have a look for you.
Tony(OTPM)
Reply With Quote
  #2  
Old 08-08-2011, 04:07 AM
terricritch terricritch is offline Code to add dates Windows 2K Code to add dates Office 2007
Novice
Code to add dates
 
Join Date: Aug 2011
Posts: 6
terricritch is on a distinguished road
Default

Thanks, have attached a briefer version of the full file (only due to the size of the main file) but this does have the bits I am trying to sort.
Terri
Attached Files
File Type: xlsm CC SOW.xlsm (89.1 KB, 13 views)
Reply With Quote
  #3  
Old 08-08-2011, 08:46 AM
OTPM OTPM is offline Code to add dates Windows 7 32bit Code to add dates Office 2010 32bit
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi
In the Validate_Fields() Function change:

If Not Weekday(Range("B7").Value) = vbMonday Then
MsgBox "Start Date must be a Monday (week beginning)", vbInformation

to

If Not Weekday(Range("B7").Value) = vbMonday Or vbTuesday Or vbWednesday Or vbThursday Or vbFriday Then
MsgBox "Start Date must be a Weekday", vbInformation

I think this will give you what you want. I am unable to step through the code because there are missing sheets.

Hope this helps.
Good luck.
Tony(OTPM)
Reply With Quote
  #4  
Old 08-11-2011, 03:54 AM
terricritch terricritch is offline Code to add dates Windows 2K Code to add dates Office 2007
Novice
Code to add dates
 
Join Date: Aug 2011
Posts: 6
terricritch is on a distinguished road
Default

Hi Tony
Thanks for this. I have copied your code over and it now just brings up the message 'start date must be a monday (week beginning)'. I have re-attached the file with other sheets included, I have managed to reduce the size by taking a lot of completed data out. On the Setup sheet and LP sheet I have added some notes in red that might explain a little more what is wanted.
Thanks again
Terri
Attached Files
File Type: xlsm CC SOW.xlsm (151.3 KB, 15 views)
Reply With Quote
  #5  
Old 08-12-2011, 06:23 AM
OTPM OTPM is offline Code to add dates Windows 7 32bit Code to add dates Office 2010 32bit
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi
Try commenting out the code that checks for a Monday and see if that gives you what you need.
Hope that helps.
Tony(OTPM)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to add dates Calendar without actual dates parnol01 Project 1 12-16-2015 09:30 AM
Code to add dates Calculating dates Daria11 Word VBA 1 06-08-2011 06:54 PM
Code to add dates Sequential Dates in Word Ultrap3 Word 2 02-04-2011 02:53 PM
Code to add dates Calculated dates. Ziggy-R Word 10 09-28-2010 01:42 AM
Adding dates mkkram Word 0 11-27-2006 09:18 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:45 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