getting a string with a month/year from a date

Cowboy_BeBa

Registered User.
Local time
Tomorrow, 01:33
Joined
Nov 30, 2010
Messages
188
Hi

I need to use VBA to get a string which is essentially just a month and year (so date, not including day)

Would Prefer it to be 04/15 as opposed to April-15, as the number is easier to sort than the word (though if anyone knows how to sort month names in numerical order as opposed to alphabetical id love to hear a way)

so that i assume i could do by =format(now(), mm/yy) (though havent actually tested it)
however to add to the complexity id also need to add a month to it, so for instance todays date is 08/04/15, id need the string to read "05/15"
or if the date was 10/12/15 id need the string to read "01/16"

does anyone know how id be able to do this?
 
You can use the DateAdd() function to add a month to the current date, and use the Format() function on that.
 
Perfect
thanks once again Pbaldy :)
 

Users who are viewing this thread

Back
Top Bottom