Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a 2D array with text strings (sheet names) in
column 1 and boolean values (1 or 0) in column 2. I want to be able to do a lookup of the boolean values for each sheet within the sheet name array while in a For Each Loop.The idea being that I will do search based on name propterty of the sheet that I am looping through. For each Sh in Workbook Lookup boolean in column 2 of SheetName Array based on sh.Name Next Not sure how to use lookups in VBA |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You might like vba FIND better. Look in the HELP index.
-- Don Guillett SalesAid Software "ExcelMonkey" wrote in message ... I have a 2D array with text strings (sheet names) in column 1 and boolean values (1 or 0) in column 2. I want to be able to do a lookup of the boolean values for each sheet within the sheet name array while in a For Each Loop.The idea being that I will do search based on name propterty of the sheet that I am looping through. For each Sh in Workbook Lookup boolean in column 2 of SheetName Array based on sh.Name Next Not sure how to use lookups in VBA |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Find doesn't work with arrays.
-- Regards, Tom Ogilvy "Don Guillett" wrote in message ... You might like vba FIND better. Look in the HELP index. -- Don Guillett SalesAid Software "ExcelMonkey" wrote in message ... I have a 2D array with text strings (sheet names) in column 1 and boolean values (1 or 0) in column 2. I want to be able to do a lookup of the boolean values for each sheet within the sheet name array while in a For Each Loop.The idea being that I will do search based on name propterty of the sheet that I am looping through. For each Sh in Workbook Lookup boolean in column 2 of SheetName Array based on sh.Name Next Not sure how to use lookups in VBA |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
An example of a lookup:
Result = Application.VLookup(ActiveSheet.Name, _ Sheet1.Range("A1:B10"), 2, False) -- Jim Rech Excel MVP "ExcelMonkey" wrote in message ... |I have a 2D array with text strings (sheet names) in | column 1 and boolean values (1 or 0) in column 2. I want | to be able to do a lookup of the boolean values for each | sheet within the sheet name array while in a For Each | Loop.The idea being that I will do search based on name | propterty of the sheet that I am looping through. | | For each Sh in Workbook | Lookup boolean in column 2 of SheetName Array based on | sh.Name | Next | | Not sure how to use lookups in VBA |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim Res as Variant
Dim Sh as Worksheet Dim bRes as Boolean For each Sh in Workbook Res = Application.VLookup(sh.Name, SheetName,2,0) if not iserror(Res) then bRes = Res end if Next -- Regards, Tom Ogilvy "ExcelMonkey" wrote in message ... I have a 2D array with text strings (sheet names) in column 1 and boolean values (1 or 0) in column 2. I want to be able to do a lookup of the boolean values for each sheet within the sheet name array while in a For Each Loop.The idea being that I will do search based on name propterty of the sheet that I am looping through. For each Sh in Workbook Lookup boolean in column 2 of SheetName Array based on sh.Name Next Not sure how to use lookups in VBA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Use array for lookup value, to return array of lookups | Excel Discussion (Misc queries) | |||
Lookup or Array or Something???? | Excel Discussion (Misc queries) | |||
Lookup "greater than or equal to" in lookup array | New Users to Excel | |||
lookup array | Excel Worksheet Functions | |||
Array Lookup | Excel Programming |