Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following code extracts text to a listbox based on a find routine.
If I try to extract further information off another sheet based on the "find" of the the first search it complains with an error code 91. The additional code is between the '=========== What am I doing wrong? Sub Fill_Task_TextBox() GroupNumber = Cells(ActiveCell.Row, 10).Value With Sheets("Tasks").Range("A3:A" & Sheets("Tasks").Range _("A65530").EndxlUp).Row) Set Task_Group = .Find(GroupNumber, lookin:=xlValues) If Not Task_Group Is Nothing Then Tasks.ListBox1.Clear FirstAddress = Task_Group.Address Tasks.ListBox1.AddItem Task_Group.Value & " __ " & _ ActiveCell(0, -1).Value & " __ " & ActiveCell.Value Tasks.ListBox1.AddItem Do Tasks.ListBox1.AddItem Task_Group.Offset(0, 1).Value & _ "-- " & Task_Group.Offset(0, 6).Value ' =============================================== Extra search Start If Len(Task_Group.Offset(0, 8).Value) 4 Then Std_txt_Number = Left(Task_Group.Offset(0, 8).Value, 6) With Sheets("Std_txt").Range("A3:A" & _ Sheets("Std_txt").Range("A65530").End(xlUp).Row) Set Stdtxt = .Find(Std_txt_Number, lookin:=xlValues) If Not Stdtxt Is Nothing Then Tasks.ListBox1.AddItem Stdtxt.Offset(0, 2).Value End If End With End If ' =============================================== Extra Search Stop Set Task_Group = .FindNext(Task_Group) Loop While Not Task_Group Is Nothing And _ Task_Group.Address < FirstAddress ' get error 91 on this line? End If Tasks.ListBox1.AddItem "" Tasks.Show End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
=IF(ISERROR(SEARCH("insurance",A125,1)),"","*") | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
using "find" or "search" to find commas | Excel Discussion (Misc queries) | |||
Binocular search tool, Excel, loses column designation at "Find" | Excel Discussion (Misc queries) | |||
"FIND" generates "Type mismatch" error | Excel Programming |