Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have written the below code fragment in Excel Vba. It copies information from several data sheets to an output sheet if the data sheetname is contained within a "map" and has been flagged with a "Y". This works fine if all the sheetnames are contained within the "map". I noticed however that vlookup falls over if I add new data sheets and don't remember to update the map at the same time. Could someone advise as to how to trap the error? For Each wks In ActiveWorkbook.Sheets If Application.VLookup(wks.Name, Range("Map!b2:c200"), 2, False) = "Y" Then Sheets("Output").Range("A:A").Offset(0, x + 1) = wks.Range("J:J").Value x = x + 1 End If Next wks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trapping errors in a VLOOKUP function | Excel Worksheet Functions | |||
Trapping errors with Conditional Formatting | Excel Discussion (Misc queries) | |||
Trapping errors | Excel Programming | |||
GetOpenFilename - Trapping Errors | Excel Programming | |||
annoying bell when trapping errors | Excel Programming |