I am faced with this problem: "Identifier too long". What can I do to fix this? I tried using a break "_" . But there will another error: Missing end bracket. Thanks guys.
Sub Netting()
Dim Found As Range
Dim LR As Long
Dim ws As Worksheet
Dim cell As Range
Dim a As Variant, v As Variant, num
Set ws = Sheets("PAYABLES - OUTFLOWS")
Set Found = ws.Rows(1).Find(What:="Invoice Amount", _
LookIn:=xlValues, lookat:=xlWhole)
If Found Is Nothing Then Exit Sub
a = [{"991",1042;"916", 1042;"954",261;"975",3004;"938",726;"901",762;"482",728; _
"482",728;"934",723;"200",724;"201",724;"952",724;"992",3030;"980",3207;"116",626;"939",722;"390",517;"484",548;"339",59;"141",717;"935",59;"994",3370;"140",8408;"950",775;"370", 734 }] 'create 2-d lookup array
LR = ws.Cells(ws.Rows.Count, Found.Column).End(xlUp).Row
Found.Offset(0, 1).EntireColumn.Insert
ws.Cells(1, Found.Column + 1).Value = "Netting"
For Each cell In ws.Range(ws.Range("C2"), ws.Cells(LR, 3))
num = CStr(Mid(cell.Value, 3, 3))
v = Application.VLookup(num, a, 2, False)
cell.EntireRow.Cells(Found.Column + 1).Value = IIf(IsError(v), "", v)
Next cell
End Sub
See Question&Answers more detail:os