-
Solved: loop Error
[vba] 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,FALS E))"
.Font.ColorIndex = 0
.Font.Name = calibri
.Font.Size = 8
.NumberFormat = "0"
.Value = .Value
End With
I = I + 1
Next I[/vba]
Im trying to create a loop in the vlookup
-
What are you trying to do?
What formulas do you want in what cells?
-
I want it the formula (vlookup) to start on row N22 and keep filling down until it hits the last row , however the vlookup needs to shift 1 to the left each time
hence
[VBA] .FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC12,FTDTL1,I,FALSE)),0,VLOOKUP(RC12,FTDTL1,I,FALS E))"
[/VBA]
In the formula above the I is 11, then then next I is 12 etc
-
start with this, what you want is a little confusing but i think this might help
[VBA].FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC12,FTDTL1," & I & ",FALSE)),0,VLOOKUP(RC12,FTDTL1," & I & ",FALSE))"[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules