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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating an excel sheet through access - problem with formula

Status
Not open for further replies.

UHNSTrust

Technical User
Dec 2, 2003
262
GB
Apostrophe added during code

--------------------------------------------------------------------------------

I am trying to create an excel file from code within an Access database.

When I use the following line in my code it works but comes out as =Sum('D22':'D35')
Code:
.ActiveSheet.Range("D" & x).FormulaR1C1 = "=SUM(D22:D" & x - 1 & ")"
The apostrophes return #NAME? error.

Can somebody help as to what I should be putting in my code to stop the apostrophes?

Thanks in advance

Jonathan
 
I have figured this out using Row and Column references insted of cells.

Thanks to anybody who had a look.

Jonathan
 
I have figured this out using Row and Column references instead of cells.

Thanks to anybody who had a look.

Jonathan
 
Bottom line:
don't use A1 notation for the Formula.R1C1 property ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top