Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

dates vba

ResolvedVersion 2007

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

Mon 28 Sep 2009: Automatically marked as resolved.

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Create a hyperlink navigation sheet

In large files, it is often useful to have a front sheet with hyperlinks to the key databases and summary calculations in your spreadsheet. Hyperlinks can save you and (more importantly) those less familiar with your spreadsheet a great deal of pointless scrolling between and within sheets.



Hyperlinks appear as underlined text and can jump to any cell or range name in your file. You can also use hyperlinks to jump to other files.



To create a hyperlink to a location in the active workbook: (1) Select the cell that contains the text you want to use as the hyperlink and choose Insert|Hyperlink.(2)Click Place in this document.(3)Choose the sheet you want to link to or the range name from the list of "Defined Names".(4)If necessary, type the cell reference in the Type in the cell reference box. (5) Click OK.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.11 secs.