Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to automatically fill a variable with the last day of the
month based on the month in another variable? For example, if var1 = 9, is there a way to program var2 = 9/30/2005 or if var1 = 8, then var2= 8/31/2005 Thanks....... -- JT |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
var2 = dateserial(2005,var1+1,0)
-- HTH Bob Phillips "JT" wrote in message ... Is there a way to automatically fill a variable with the last day of the month based on the month in another variable? For example, if var1 = 9, is there a way to program var2 = 9/30/2005 or if var1 = 8, then var2= 8/31/2005 Thanks....... -- JT |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the help........This community is a terrific resource
-- JT "Bob Phillips" wrote: var2 = dateserial(2005,var1+1,0) -- HTH Bob Phillips "JT" wrote in message ... Is there a way to automatically fill a variable with the last day of the month based on the month in another variable? For example, if var1 = 9, is there a way to program var2 = 9/30/2005 or if var1 = 8, then var2= 8/31/2005 Thanks....... -- JT |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is weird:
In Bob's reply I see "var2 = dateserial(2005,var1,0)" and was going to correct it. But then noticed in JT's quoted reply to Bob "var2 = dateserial(2005,var+1,0)", correct. Is it just my OE reader or anyone else seeing the same ? NickHK "Bob Phillips" wrote in message ... var2 = dateserial(2005,var1,0) -- HTH Bob Phillips "JT" wrote in message ... Is there a way to automatically fill a variable with the last day of the month based on the month in another variable? For example, if var1 = 9, is there a way to program var2 = 9/30/2005 or if var1 = 8, then var2= 8/31/2005 Thanks....... -- JT |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nick, I had something like that the other day.
I posted a response, and the OP had a problem because parts of the text just disappeared. I re-posted with the full text and she had no problem then. -- HTH Bob Phillips "NickHK" wrote in message ... This is weird: In Bob's reply I see "var2 = dateserial(2005,var1,0)" and was going to correct it. But then noticed in JT's quoted reply to Bob "var2 = dateserial(2005,var+1,0)", correct. Is it just my OE reader or anyone else seeing the same ? NickHK "Bob Phillips" wrote in message ... var2 = dateserial(2005,var1,0) -- HTH Bob Phillips "JT" wrote in message ... Is there a way to automatically fill a variable with the last day of the month based on the month in another variable? For example, if var1 = 9, is there a way to program var2 = 9/30/2005 or if var1 = 8, then var2= 8/31/2005 Thanks....... -- JT |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi JT,
Try something like: Sub AAA() Dim var As Long Dim LastDayOfMonth As Date var = 8 LastDayOfMonth = DateSerial(Year(Date), var + 1, 0) MsgBox LastDayOfMonth End Sub --- Regards, Norman "JT" wrote in message ... Is there a way to automatically fill a variable with the last day of the month based on the month in another variable? For example, if var1 = 9, is there a way to program var2 = 9/30/2005 or if var1 = 8, then var2= 8/31/2005 Thanks....... -- JT |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
count month when date is in day/month/year format | Excel Worksheet Functions | |||
excel to make the days cary over month to month automaticly | New Users to Excel | |||
Excel 2003 month to month data change grid | Excel Discussion (Misc queries) | |||
Converting Month Number to Month Text Abbreviation | Excel Worksheet Functions | |||
transfer cell $ amount to other sheet month-to-month without overc | Excel Discussion (Misc queries) |