Thread: month name
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default month name

here's one way:

Sub test()
Dim dt As Date
dt = InputBox("Enter Date")
Worksheets("sheet1").Name = MonthName(Month(dt))
End Sub

or

Sub test()
Dim dt As Date
dt = InputBox("Enter Date")
ActiveSheet.Name = MonthName(Month(dt))
End Sub

--


Gary


"RobcPettit" wrote in message
...
Hi, using an input box in vba, were a date ia added, I want to name
worksheets based on the month of the given date. For example if
21/6/08 was entered, then my worksheet will be called June. How do I
get the information using vba.
Regards Robert