View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
PaulW PaulW is offline
external usenet poster
 
Posts: 130
Default =DATE() function in VBA?

I have a list of months in a combobox, and the year in a textbox. I want to
set a variable to the date generated. So if it was a formula it would be

=DATE(Textbox1.value , Combobox1.listindex + 1, 1)

Getting the first day of the month. But I want to do it in VBA code. The
=DATE() function doesn't seem to be in
Application.Worksheetfunction
And if I try to just add the stuff together for the variable I end up with a
text string that I can't manipulate.

Is there a way for me to use the year from textbox and the month from a
combobox and end up with an actual date to use?

(I will be using this information to populate commandbutton captions so I
have something similar to the built in Calender object but which I can
manipulate easier)