Jason Sawyer
New Member
- Joined
- May 20, 2009
- Messages
- 3
I turn to you all again as this site has been my best resource.
I am using an Excel macro open a Reflection session. I run this daily but the variables vary each day.
What I need is the start to be the first day of the month from yesterday. example:
From - 06012009
To - 06242009 (as today is the 06/25/09)
Here is what I tried.
sDate = VBA.Format(Now, "mmddyyyy")
fDate = Left(sDate, 2) & "01" & Right(sDate, 4)
tDate = Left(sDate, 2) & (Mid(sDate, 3, 2) - 1) & Right(sDate, 4)
And then
.Transmit fDate & Chr(13)
etc.
Well, this has proven that Excel is much smarter than I am.
I am using an Excel macro open a Reflection session. I run this daily but the variables vary each day.
What I need is the start to be the first day of the month from yesterday. example:
From - 06012009
To - 06242009 (as today is the 06/25/09)
Here is what I tried.
sDate = VBA.Format(Now, "mmddyyyy")
fDate = Left(sDate, 2) & "01" & Right(sDate, 4)
tDate = Left(sDate, 2) & (Mid(sDate, 3, 2) - 1) & Right(sDate, 4)
And then
.Transmit fDate & Chr(13)
etc.
Well, this has proven that Excel is much smarter than I am.