user7415328
user7415328

Reputation: 1083

Excel Formula in vba?

I am trying to insert the following formula using vba:

Cells(i, 17).Formula = "=IF(""" & Range("M" & i).value & """ = """","""",IFERROR(INDEX(Contacts!$D:$D,MATCH(""*"" & """ & Range("M" & i).value & """ & ""*"",Contacts!$C:$C,0)),"""")"

For some reason i get an application undefined error. Please can someone show me where i am going wrong?

Upvotes: 0

Views: 51

Answers (1)

Scott Craner
Scott Craner

Reputation: 152450

You are missing a )

Cells(i, 17).Formula = "=IF(""" & Range("M" & i).value & """ = """","""",IFERROR(INDEX(Contacts!$D:$D,MATCH(""*"" & """ & Range("M" & i).value & """ & ""*"",Contacts!$C:$C,0)),""""))"

Upvotes: 4

Related Questions