Excel VBA - Worksheet Function Syntax in VBA

Sheets(a.Name).Range("T2").Offset(is + 2, 0).Value = "=Sumif(T" & 2 & ":" & "T" & is + 1 & "," & " '<0'" & ",D" & 2 & ":" & "D" & is + 1 & ")"  

I get the application error on excel when I try to write the worksheet function in vba. The highlighted place is the <0 part which should be like "<" .

Thanks
awesomejohn19Asked:
Who is Participating?
 
nutschCommented:
you cannot use is as a variable, use somethingelse instead
a.range("T2").Offset(somethingelse + 2, 0).Formula = "=Sumif(T2:T" & somethingelse + 1 & ",'<0',D2:D" & somethingelse + 1 & ")"

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.