Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Variables with Edate 1

Status
Not open for further replies.

WaterSprite

Technical User
Mar 23, 2004
69
0
0
US
[Dim x As Date, xx As Integer]

[x = Cells(1, 1).Value]
[xx = 12]
[Cells(2, 1).FormulaR1C1 = "=Edate(R1C,R1C2)"]

Can I use "Edate" with variables, as in the line of code below.
If I could at least figure out how to use a variable for 12 it would help a lot.

[Cells(2, 1).FormulaR1C1 = "=Edate(x,xx)"]

Thanks for any help.
 
It's necessary to build a formula string:
Code:
Cells(2, 1).Formula = "=Edate(" & CLng(x) & "," & xx & ")"

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top