Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello!,
How I could get the starting and ending date of a month based on month name. For Eg. say I have combobox1 and textbox1 and textbox2. If i select january from combobox1 i want to get 1/1/2006 in textbox1 and 31/1/2006 in textbox2 .. thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
you don't mention how you get the month names into the combobox
this is a simple overview: i would probably use a rowsource from a sheet with the first day of each month in a cell something like Sheet3!A1:a12 then fill and format the combobox with the month name then textbox 1 could be the value from sheet3!a1 and text box 2 could be this formula =EOMONTH(A1+1, 0) or =EOMONTH(me.textbox1.value +1, 0) -- Gary "Abdul" wrote in message ups.com... Hello!, How I could get the starting and ending date of a month based on month name. For Eg. say I have combobox1 and textbox1 and textbox2. If i select january from combobox1 i want to get 1/1/2006 in textbox1 and 31/1/2006 in textbox2 .. thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Abdul,
Try something like: '============= Public Sub Tester() Dim sStr As String Dim arr As Variant Dim iMonth As Long Dim myDate1 As Date Dim myDate2 As Date arr = Array("January", "February", "March", _ "April", "May", "June", "July", _ "August", "September", "October", _ "November", "December") sStr = "February" iMonth = Application.Match(sStr, arr, 0) myDate1 = DateSerial(Year(Date), iMonth, 1) myDate2 = DateSerial(Year(Date), iMonth + 1, 0) MsgBox myDate1 & vbNewLine & myDate2 End Sub '<<============= --- Regards, Norman "Abdul" wrote in message ups.com... Hello!, How I could get the starting and ending date of a month based on month name. For Eg. say I have combobox1 and textbox1 and textbox2. If i select january from combobox1 i want to get 1/1/2006 in textbox1 and 31/1/2006 in textbox2 .. thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date arithmetic: adding 1 month to prior end of month date | Excel Worksheet Functions | |||
Sort month/date/year data using month and date only | Excel Discussion (Misc queries) | |||
=VLOOKUP(1,Nationality!B5:B29,IF(MONTH(date)6,MONTH(date)-6, MON | Excel Worksheet Functions | |||
Determine begin month date from month end date. | Excel Programming | |||
Convert "Month" to "MonthName" format from db to PivotTable | Excel Programming |