Khurram has attended:
Excel VBA Intro Intermediate course
Dates in VBA
If i wanted to insert a date, which would change on a daily bassis excluding bank holidays what code could i use?
thanks
Khurram
RE: dates in VBA
Hi Khurram
Thank you for your question
This would be a substantial undertaking. You would need code that would compare the current date with a list of bank holiday dates. These dates would be contained in a range within a spreadsheet. You would need to build a loop that goes through the range a cell at a time and sees if any of them match todays date. If there was no match you would need to enter todays date. If however there was a match, you would need to increase today's date by one and then run this through the list of bank holidays. Keep increasing by 1 until you find a date not in the list, and insert this date.
Regards
Stephen