Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
FindMethod 2 col range
Hi Group, Have the code below. The names I´am looking for are in Range("E1:E50") and could appear at least two times in the range. To not only find the first name selected in Textbox1 I also need to check the values in Range("F1:F50") to find an exclusive value. The value to find in the later range is in ComboBox1. Is it possible to do this with the Find method? Brgds CG Rosén Dim z With Sheets("constants").Range("E1:E50") Set z = .Find(TextBox1.Text, LookIn:=xlValues, SearchOrder:=xlByColumns) If z Is Nothing Then code...... Else code........ End If End With |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
FindMethod 2 col range
Dim z as Range, bFnd as Boolean
Dim fAddr as String With Sheets("constants").Range("E1:E50") Set z = .Find(TextBox1.Text, LookIn:=xlValues, SearchOrder:=xlByColumns) bFnd = False If z Is Nothing Then msgbox Textbox1.Text & " is not found" Else if z.offset(0,1).Value = Combobox1.Value then z.Select bFnd = True msgbox Textbox1.Text & " is found at " & z.address else fAddr = z.address Do set z =.FindNext(z) if z.offset(0,1).Value = Combobox1.Value then z.select bFnd = True msgbox Textbox1.Text & " is found at " & z.address exit do End if Loop until z.address = fAddr End if if not bFnd then msgbox Textbox1.Text & " not found next to " & _ Combobox1.Value End If End With -- Regards, Tom Ogilvy "CG Rosén" wrote in message ... Hi Group, Have the code below. The names I´am looking for are in Range("E1:E50") and could appear at least two times in the range. To not only find the first name selected in Textbox1 I also need to check the values in Range("F1:F50") to find an exclusive value. The value to find in the later range is in ComboBox1. Is it possible to do this with the Find method? Brgds CG Rosén Dim z With Sheets("constants").Range("E1:E50") Set z = .Find(TextBox1.Text, LookIn:=xlValues, SearchOrder:=xlByColumns) If z Is Nothing Then code...... Else code........ End If End With |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
FindMethod 2 col range
Hi Tom,
Many thanks, could never found out this myself but I´am learning. Brgds CG Rosén |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I enter formula sum(range+range)*0.15 sumif(range=3) | Excel Discussion (Misc queries) | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
FindMethod-DateValues | Excel Programming | |||
find worksheet by FindMethod | Excel Programming | |||
Range in FindMethod? | Excel Programming |