? about the VBA code

D

duster

basically i am trying to write code that puts formulas in cell
depending on something else

i depending on if some things are true our not it will get things fro
another spreadsheet if row b is true it uses that but if row C is i
uses that. the only way i can figure out how to make it work is to do
if true statment and look at each row (true will only occure once) an
then do the operations. the operatons are almost the exact same but on
little thing

Range("C4").Select
ActiveCell.FormulaR1C1 = _
"=IF('[Payroll Template.xls]Sheet1'!R7C3>17.5,IF('[Payrol
Template.xls]Sheet1'!R6*C3*>17.5,'[Payrol
Template.xls]Sheet1'!R6C3,17.5),0)"


one examplewere the bold thing will change everytime is there anyway
could make that a int or something and just change taht one value the
run the formula stuff, the only way i have been able to make it work i
by doing formula's for each different values

i hope i explained this good enough i have not had much sleep bee
playing to hard but thanks for any hel
 
B

BrianB

Something like this ... ?


Code
-------------------
If ActiveSheet.Range("a1").Value <> 0 Then
Range("C4").FormulaR1C1 = _
Else
Range("C4").FormulaR1C1 = _
End If
 
D

duster

no not really

i am looking for something like c++ were i make my column an int s
that i can change it and it will change the formula depending on what
store in that in
 
Top