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

adding calc using cell

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

ResolvedVersion 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:

Application.WorksheetFunction.???
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)"


Tried

'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 sw@stl-training.co.uk

Thanks

Stephen

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:

sk@stl-training.co.uk

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

Regards

Simon

RE: Adding in a calc using cell refernces

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

Ta

D

 

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:

Choosing data types in Access

Not sure which data type to use for your Access fields? Here are some guidelines to help you choose a data type to assign to a field.

- The Text data type can accept up to 255 characters. For information that will be recorded in paragraphs, use Memo.

- Also use Text for numbers that aren't going to be used in calculations, e.g. phone numbers.

- Use the Currency data type for monetary amounts.

- Use Date/Time for dates.

- Most other numbers can use the Number data type, but the Field Size property may have to be altered.

- For fields that have only two alternatives (yes, no) use Yes/No data type. If there is likely to be a third entry option (e.g. maybe or don't know) use Text instead.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.