Are the buffer values text? Then you're missing quotes, I think.
This works for me if I include the range (often 1004 errors are range related):
activesheet.range("K6").formula = "=IF(I6=""Blind""," & """yes"",""no"")"
This also works:
range("K6").formula = "=IF(I6=""Blind""," & """yes"",""no"")"
This doesn't raise an error but does produce a weird formula result:
activecell.FormulaR1C1 = "=IF(I6=""Blind""," & """yes"",""no"")"
hi Miron,
Thanks for the reply.
The buffer is a array i use to store cells.
This is my code to store the cell into buffer.
For x = 0 To 3
header = Array("Include GST", "Cost/Quotation", "Online Price", "Qty")
Sheets(1).Select
Sheets(1).Cells.Find(What:=header(x), After:=ActiveCell, LookIn:=xlFormulas2, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.Offset(1, 0).Select
Set buffer2(x) = Selection
buffer2(x) = ActiveCell
Debug.Print buffer2(x).Address
Next x
the above code should be correct cause when i print the address it give me the result i want
but after that i try to set one cell to the following formula it gives me error
following is the result i trying to achieve
=IF(H2="yes",IF(I2=0,F2*0.07,SUMPRODUCT(I2,J2) * 0.07),0)
I try to use the variable because i don't want to fix the location, as the location of the header might change