hi all, i am using a udf that uses vlookallsheets, the code below needs teaking, I would like to know how to add another sheet (Summary!) in this line, i dont know how its written
[If wSheet.Name <> "master" Then],
is it something like -- If wSheet.Name <> "master" and & or "summary" Then????
any assistance would be appreciated
full code =
[Function VLOOKAllSheets( _
Look_Value As Variant, _
Tble_Array As Range, _
Col_num As Integer, _
Optional Range_look As Boolean)
''''''''''''''''''''''''''''''''''''''''''''''
'Use VLOOKUP to Look across ALL Worksheets and stops _
'at the first match found.
'''''''''''''''''''''''''''''''''''''''''''''''''
Dim wSheet As Worksheet
Dim vFound
On Error Resume Next
For Each wSheet In ActiveWorkbook.Worksheets
If wSheet.Name <> "master" Then
With wSheet
Set Tble_Array = .Range(Tble_Array.Address)
vFound = WorksheetFunction.VLookup _
(Look_Value, Tble_Array, _
Col_num, Range_look)
End With
If Not IsEmpty(vFound) Then Exit For
End If
Next wSheet
Set Tble_Array = Nothing
VLOOKAllSheets = vFound
End Function]
[If wSheet.Name <> "master" Then],
is it something like -- If wSheet.Name <> "master" and & or "summary" Then????
any assistance would be appreciated
full code =
[Function VLOOKAllSheets( _
Look_Value As Variant, _
Tble_Array As Range, _
Col_num As Integer, _
Optional Range_look As Boolean)
''''''''''''''''''''''''''''''''''''''''''''''
'Use VLOOKUP to Look across ALL Worksheets and stops _
'at the first match found.
'''''''''''''''''''''''''''''''''''''''''''''''''
Dim wSheet As Worksheet
Dim vFound
On Error Resume Next
For Each wSheet In ActiveWorkbook.Worksheets
If wSheet.Name <> "master" Then
With wSheet
Set Tble_Array = .Range(Tble_Array.Address)
vFound = WorksheetFunction.VLookup _
(Look_Value, Tble_Array, _
Col_num, Range_look)
End With
If Not IsEmpty(vFound) Then Exit For
End If
Next wSheet
Set Tble_Array = Nothing
VLOOKAllSheets = vFound
End Function]