|
-
Jan 11th, 2013, 05:09 PM
#1
Thread Starter
Junior Member
[RESOLVED] Using Formula in VBA for Microsoft Excel. Unexpected results.
Hi all!
Sorry, but I'm going to be breif since I don't have much time....
I'm trying to create a formula cell that references only two others for simple multiplication.
I've tried using FormulaR1C1, which should work, but it didn't.
So instead, I used the "Formula" function (This is a much simpler line of code compared to the FormulaR1C1 line that I had)
Code looks like this:
"a" is a dimensioned Integer that represents the current row.
Code:
xlWS.Cells(a, 15).Formula = "=" & xlWS.Cells(a, 6).Address & "*D3"
Which I would think should work... except it doesn't. Instead I get cells that are NOT multiplied by D3. Sometimes the resulting value is #REF! or #VALUE!
In other words, the resulting cell value is pretty much unpredictable. :P
If anybody know why the case may be, your help is greatly appreciated 
Thanks, and God Bless!
Last edited by Millerni456; Jan 14th, 2013 at 07:57 AM.
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
|