|
-
Mar 10th, 2010, 07:55 AM
#1
Thread Starter
Junior Member
[RESOLVED] Excel VBA - Multiply Function
Hi,
I'm trying to input a formula into a particular cell, of which the formula involves a pre-defined variable, as below:
Range("C" & Rw).formula = "= Range("A" & Rw) * Range("B" & Rw) *100"
However, it seems to be incorrect as the error highlights on the "A" and/or "B".
I am very sure that the pre-defined 'Rw' work fine.
COuld you please help me in this formula application?
Thank you
xwxc
-
Mar 10th, 2010, 03:52 PM
#2
Re: Excel VBA - Multiply Function
try like
Range("C" & Rw).Formula = "=" & Range("A" & Rw).Address & " * " & Range("B" & Rw).Address & " *100"
but it may be better to use r1c1 notation
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Mar 23rd, 2010, 09:56 AM
#3
Thread Starter
Junior Member
Re: Excel VBA - Multiply Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|