Hi Guys,

I am trying to insert this formula:

using this code:

It is giving me an error.

What is it that I am doing wrong? Can you please help me out?

Asad

I am trying to insert this formula:

Code:

`{=IFERROR(PROPER(IF(B5="","",IF(AND(C$1=E$1,MID(B5,2,1)*1=1),INDEX(INDIRECT(F$1&"B13:B193"),MATCH(B5,INDIRECT(F$1&"AT13:AT193"),0)),INDEX(Express_Names,MATCH(B5,INDIRECT("Express!"&HLOOKUP(A$1-C5,Express!$D$10:$J$11,2,0)&"13:"&HLOOKUP(A$1-C5,Express!$D$10:$J$11,2,0)&"193"),0))))),"")}`

Code:

```
Dim fp As Range, rng As Range, c As Range
Set fp = Range("F1")
Set fpl = Range("H1")
Set rng = Range("D5", "D14")
For Each c In rng
c.FormulaArray = "=iferror(proper(if(" & c.Offset(, 2).Address & "="""","""",If(and(" & Range("c1") & "=" & Range("E1") & ",MID(" _
& c.Offset(, 2).Address & ",2,1)*1=1),Index(" & fp & "B13:B193,Match(" & c.Offset(, 2).Address & "," & fp & "AT13:At193,0)),Index(" & Express_Names & ",Match(" _
& c.Offset(, 2).Address & "," & fpl & ",0))))),"""")"
Next c
```

What is it that I am doing wrong? Can you please help me out?

Asad

Last edited: