Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I make this code not error if the value in cboCarPartModel is
not found in my wo worksheet? It works fine if the value is found but errors if not found. Jody Private Sub cboCarPartModel_Change() Dim wo As Range Set wo = Worksheets("cpModels").Range("cpModelNameAndNumber s") If Me.cboCarPartModel.Value "" Then Label3.Caption = Application.VLookup(cboCarPartModel.Value, wo, 2, False) End If End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi SS,
One way: Private Sub cboCarPartModel_Change() Dim wo As Range Set wo = Worksheets("cpModels").Range("cpModelNameAndNumber s") If Me.cboCarPartModel.Value "" Then On Error Resume Next Label3.Caption = _ Application.VLookup(cboCarPartModel.Value, wo, 2, False) If Err.Number < 0 Then MsgBox "Not found!" On Error GoTo 0 End If End Sub --- Regards, Norman "ssjody" wrote in message oups.com... How do I make this code not error if the value in cboCarPartModel is not found in my wo worksheet? It works fine if the value is found but errors if not found. Jody Private Sub cboCarPartModel_Change() Dim wo As Range Set wo = Worksheets("cpModels").Range("cpModelNameAndNumber s") If Me.cboCarPartModel.Value "" Then Label3.Caption = Application.VLookup(cboCarPartModel.Value, wo, 2, False) End If End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Norman! Works Great!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VLOOKUP would begin one row below what the first one found? | Excel Worksheet Functions | |||
Formula have a VLOOKUP but want it to =0 if no value is found | Excel Worksheet Functions | |||
VLookup Value not found ? | Excel Discussion (Misc queries) | |||
vlookup not found | Excel Worksheet Functions | |||
use Vlookup for sum all found value? | Excel Programming |