adding calc using cell

Public Schedule Face-to-Face & Virtual Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » Adding in a calc using cell refernces

Adding in a calc using cell refernces

resolvedResolved · High Priority · Version 2007

Donna has attended:
Excel VBA Intro Intermediate course

Adding in a calc using cell refernces

I want to use my named VBA integer which holds the Row size of the imported table to add in a % calc lower down on a newly created copied table.

I've tried loads and assumed my best option was:

However I can find one for = Same column up 24 rows (Inrowcount + 2) / same column up 15 rows (introwcount - 9)

Ideally I like the introwcount to be $introwcount as all percentages will be driven from this row.

This one worked if type but I can't use the cell refences for it:

ActiveCell.FormulaR1C1 = "=(R[-24]C/R[-15]C)"


'Sheets(StrShtName).Cells(1, 1).Value = "+B" & Cells(-24, 1) & "/B$" & Cells(-16, 1)

ActiveCell.FormulaR1C1 = "=(R[-24]C/R[-15]C)"

ActiveCell.FormulaR1C1 = "(R[" &intpercentslave& "C/R[" &intpercentmaster"&]C)"

Please help

Donna Leach

RE: Adding in a calc using cell refernces

Hi Donna

Thanks for the question

This is tricky to solve without seeing the actual worksheet. Could you send me an example of the data and I will build a function for you that solves the problem.

My email is



RE: Adding in a calc using cell refernces

Hi Donna,

I am just following up the outstanding question on out Forum.

Unfortunately Stephen is out of action and has been for a couple of months.

Can I check whether you sent the excel spreadsheet to Stephen after his request?

If you didn't and it hasn't been resolved, please send it to:

My VBA colleagues and I can then have a look and see whether we can resolve your Post for you.



RE: Adding in a calc using cell refernces

I found it all by myself, Dim ***** Long, seems to work ok.




Training courses


Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


Access tip:

Hiding rows and columns

To hide a column or row in Access, you need to minimise the column or row. This can be done by placing your mouse on the right edge of a column, wait for the mouse to change to a double aroow and then drag to minimise the column

View all Access hints and tips

Server loaded in 0.07 secs.