Ethan Bradberry
Ethan Bradberry

Reputation: 107

Quotes in VBA formula

I'm trying to figure out what i'm doing wrong i'm trying to add quotation marks to "engine oils" below. but it keeps giving me an error.

can anyone see what i'm doing wrong?

Sheets("PDF Copy").Cells(t, 6).Formula = "=IF(Daily!I8" & i & "=""ENGINE OILS"" ,DAILY!I" & i & ",Daily!K" & i

Upvotes: 1

Views: 66

Answers (1)

user4039065
user4039065

Reputation:

You are missing a closing bracket.

'=IF(Daily!I810="ENGINE OILS",Daily!I10,Daily!K10)
Sheets("PDF Copy").Cells(2, 6).Formula = _
    "'=IF(Daily!I8" & i & "=""ENGINE OILS"" ,DAILY!I" & i & ",Daily!K" & i & ")"

Upvotes: 2

Related Questions