0

I'm new to VBA code for excel and I am somewhat rusty on my back-end coding. I am currently having trouble converting this formula:

=IF(AND(J7>=12,K7>=1250,L7>=480),"Y","N")

This formula is drawing from three different columns. I am also trying to add this formula to every cell under column("Q"), "Q2" is where the formula is suppose to start working. The closest I have gotten is:

Sub Add_FmlFormula()    
    Range("Q2").Formula = "=IF(AND(G4>=12,H4>=1250,I4>=480),"Y","N")"    
    Range("Q2", "Q" & Cells(Rows.Count, 1).End(xlUp).Row).FillDown    
End Sub

If anyone can point me in the right direction, I would appreciate it.

p._phidot_
  • 1,913
  • 1
  • 9
  • 17
Josh R
  • 1
  • 1
    If you have double quotes inside of double quotes you have to escape them (telling the compiler to treat them as just regular old double quotes). The way you do that is by sticking another double quote in front of them. So: `Range("Q2").Formula = "=IF(AND(G4>=12,H4>=1250,I4>=480),""Y"",""N"")"` – JNevill Oct 04 '18 at 19:54
  • The right-hand side is looking two rows ahead??? Answer is going into Q2 but all sources are from row 4 columns G/H/I ?? – donPablo Oct 04 '18 at 23:17

0 Answers0