dates vba

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

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Dates in VBA

Dates in VBA

resolvedResolved · Low Priority · Version 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:

Creating a range of monthly payments as text

You could use a formula to create a range of payment ie. payment amount for x% to y% rate with fixed terms and principle.

The text that would be "between Xamount and Yamount".

Here is how to do it.

1 Use the PMT function to get your monthly payments figure or whatever frequency of payments that you choose he start range.

See PMT under Excel Help

2. Nest these in the ROUND function to round decimals see ROUND under Excel Help


3. Concatenate this using "&" and concatenate " to " and concatenate "Between ".

4. Concatenate the above to PMT function for the end range

ie.

="Between "&ROUND((PMT1),decimal places)&" and "&ROUND((PMT2),decimal places)

View all Excel hints and tips


Server loaded in 0.08 secs.