Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This code works until I get to the last line and then it fails with
this error message "AutoFill method of Range class Failed", does anyone have a clue why? Dim lastRow9 As Long lastRow9 = Worksheets("Working Sheet").Cells(Rows.Count, "B").End(xlUp).Row Range("a2").Formula = "=IF(ISNA(VLOOKUP(RC[1],tbl, 3,FALSE)),"""",VLOOKUP(RC[1],tbl,3,FALSE))" Range("A2").AutoFill Destination:=Range("A2:A" & lastRow9) ' Insert Column for Type Sheets("Working Sheet").Select Columns("C:C").Select Selection.Insert Shift:=xlToRight Selection.NumberFormat = "General" 'Populate Column D with Type Dim lastRow8 As Long lastRow8 = Worksheets("Working Sheet").Cells(Rows.Count, "B").End(xlUp).Row Range("C2").Formula = "=IF(ISNA(VLOOKUP(RC[1],tbl, 4,FALSE)),"""",VLOOKUP(RC[1],tbl,4,FALSE))" Range("C2").AutoFill Destination:=Range("C1:C" & lastRow8) <-THIS ROW FAILS IN MACRO |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Vlookup, Index, Match every instance. | Excel Discussion (Misc queries) | |||
VLOOKUP more than one instance | Excel Discussion (Misc queries) | |||
How do I get one instance of Excel to communicate with another instance? | Excel Programming | |||
Vlookup adding more than one instance | Excel Discussion (Misc queries) | |||
Vlookup to find Second INstance | Excel Worksheet Functions |