khalid79m
07-06-2011, 07:18 AM
For I = 11 To 18
With ThisWorkbook.Sheets("CD").Range("N22:N" & LRCD1)
'.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC12,FTDTL1,11,FALSE)),0,VLOOKUP(RC12,FTDTL1,11,FALSE))"
.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC12,FTDTL1,I,FALSE)),0,VLOOKUP(RC12,FTDTL1,I,FALSE))"
.Font.ColorIndex = 0
.Font.Name = calibri
.Font.Size = 8
.NumberFormat = "0"
.Value = .Value
End With
I = I + 1
Next I
Im trying to create a loop in the vlookup
With ThisWorkbook.Sheets("CD").Range("N22:N" & LRCD1)
'.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC12,FTDTL1,11,FALSE)),0,VLOOKUP(RC12,FTDTL1,11,FALSE))"
.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC12,FTDTL1,I,FALSE)),0,VLOOKUP(RC12,FTDTL1,I,FALSE))"
.Font.ColorIndex = 0
.Font.Name = calibri
.Font.Size = 8
.NumberFormat = "0"
.Value = .Value
End With
I = I + 1
Next I
Im trying to create a loop in the vlookup