Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
formula in code
hi,
i have the following: Dim CurrentReportMonth As Date CurrentReportMonth = "=DATE(YEAR(NOW()),MONTH(NOW())-1+0,1)" i am trying to figure out how i can make this work, like setting the currentreportmonth in code, but i keep getting the error message. what am i doing wrong? thanks in advance, geebee |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
formula in code
Dim CurrentReportMonth As Date CurrentReportMonth = DateSerial(Year(Date),Month(Date)-1,1) -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "geebee" (noSPAMs) wrote in message ... hi, i have the following: Dim CurrentReportMonth As Date CurrentReportMonth = "=DATE(YEAR(NOW()),MONTH(NOW())-1+0,1)" i am trying to figure out how i can make this work, like setting the currentreportmonth in code, but i keep getting the error message. what am i doing wrong? thanks in advance, geebee |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
formula in code
Sub gibbs()
Dim CurrentReportMonth As Date CurrentReportMonth = Evaluate("DATE(YEAR(NOW()),MONTH(NOW())-1+0,1)") MsgBox (CurrentReportMonth) End Sub -- Gary''s Student - gsnu200787 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using formula in code | Excel Programming | |||
formula or vba code | Excel Programming | |||
Help with Formula in Code | Excel Programming | |||
Add formula in the code | Excel Programming | |||
formula to code help | Excel Programming |