View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Select sheet based on userform date input

Dim mnth as String
mnth = Format(cdate(Textbox1.Text),"mmm")

Produces Mar for example. To get March, change mmm to mmmm

if you want a number between 1 and 12 inclusive

Dim mnth as Long
mnth = Format(cdate(Textbox1.Text),"m")

--
Regards,
Tom Ogilvy

"mugitty" wrote in
message ...

I have a workbook that is used for scheduling deliveries.

Sheet 1 is a "Control Panel" which among other things will pop up an
entry form for "New Deliveries".
Sheet 2 is set up as a list which receives the data from the userform.

This all works as desired presently, but I want to write the data from
the userform to a separate sheet by month based on the delivery date
entered on the form.

The form has a permanently visible calendar which when clicked writes
the selected date to a text box right below the calendar (as
mm/dd/yy).

How can I pull the month only from the text box and use it to determine
which of the monthly sheets will be activated for writing the data from
the form?


--
mugitty
------------------------------------------------------------------------
mugitty's Profile:

http://www.excelforum.com/member.php...o&userid=30713
View this thread: http://www.excelforum.com/showthread...hreadid=503804