f2e4
06-02-2008, 06:44 AM
Hey people,
I have created the following function which works fine with typed in:
=SUMPRODUCT(Workload!J$4:J$1000, (Workload!$G$4:$G$1000 = $B4) + 0, (Workload!$F$4:$F$1000 = "Projects") + 0)
But when i try and enter this into VBA as the following:
Range("F4").Formula = "=SUMPRODUCT(Workload!J$4:J$1000, (Workload!$G$4:$G$1000 = $B4) + 0, (Workload!$F$4:$F$1000 = "Projects") + 0)"
I get a syntax error!!!
The theory is:
Sum a load of figures in column J providing the following are correct:
1. The correct name is valid in column G
2. 'Projects' is in column F
Anyone know why I am getting this error?
I have created the following function which works fine with typed in:
=SUMPRODUCT(Workload!J$4:J$1000, (Workload!$G$4:$G$1000 = $B4) + 0, (Workload!$F$4:$F$1000 = "Projects") + 0)
But when i try and enter this into VBA as the following:
Range("F4").Formula = "=SUMPRODUCT(Workload!J$4:J$1000, (Workload!$G$4:$G$1000 = $B4) + 0, (Workload!$F$4:$F$1000 = "Projects") + 0)"
I get a syntax error!!!
The theory is:
Sum a load of figures in column J providing the following are correct:
1. The correct name is valid in column G
2. 'Projects' is in column F
Anyone know why I am getting this error?