Billy Hill
Board Regular
- Joined
- Dec 21, 2010
- Messages
- 73
I'm trying to get a formula into a cell from a macro and I'm getting a single quote isolating what should be a cell reference.
The current formula works fine, it looks like this:
=0.85+(75/D2290)+(0.3*0)
The formula I'm trying to make should come out like this, dividing D2290 by Cell K1:
=0.85+(75/(D2290*K1))+(0.3*0)
But it comes out like this instead with single quotes around the K1:
=0.85+(75/(D2290*'K1'))+(0.3*0)
This gives me a "#NAME" error.
Here is the code to create the formula that works:
ActiveCell.FormulaR1C1 = "=" & M & "+(" & P & "/RC[-3])+(.3*" & H & ")"
And here is the code that I thought would work but doesn't:
ActiveCell.FormulaR1C1 = "=" & M & "+(" & P & "/(RC[-3]*K1))+(.3*" & H & ")"
How do I get rid of the single quotes around the K1?
Thanks in advance!
The current formula works fine, it looks like this:
=0.85+(75/D2290)+(0.3*0)
The formula I'm trying to make should come out like this, dividing D2290 by Cell K1:
=0.85+(75/(D2290*K1))+(0.3*0)
But it comes out like this instead with single quotes around the K1:
=0.85+(75/(D2290*'K1'))+(0.3*0)
This gives me a "#NAME" error.
Here is the code to create the formula that works:
ActiveCell.FormulaR1C1 = "=" & M & "+(" & P & "/RC[-3])+(.3*" & H & ")"
And here is the code that I thought would work but doesn't:
ActiveCell.FormulaR1C1 = "=" & M & "+(" & P & "/(RC[-3]*K1))+(.3*" & H & ")"
How do I get rid of the single quotes around the K1?
Thanks in advance!