Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find a value in a worksheet
When I run the following code I get an error on the Cells.Find line of code:
Open strFile1 For Input As #1 Open strFile2 For Output As #2 Workbooks.Open FileName:=strFile3 Do While Not EOF(1) Line Input #1, MyRecord MyFields = Split(MyRecord, ",") For FieldPointer = LBound(MyFields) To UBound(MyFields) strVar1 = MyFields(0): strVar2 = MyFields(1): strVar3 = MyFields(2) Range("D1").Activate Cells.Find(What:=strVar2, After:=ActiveCell, LookIn:=xlValues, LookAt _ :=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase _ :=False, SearchFormat:=False).Activate ' Process data Next Loop The error message says "Object variable or With block variable not set" This code was working so not quite sure why it quit working. I'm running the code in VB 6.0 Thanks,Sam |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find in another worksheet and copy to original worksheet. | Excel Programming | |||
how to find and unlink current worksheet from old worksheet | Excel Discussion (Misc queries) | |||
Find Max Value in WorkSheet | Excel Worksheet Functions | |||
Find worksheet | Excel Programming | |||
find last row on a worksheet | Excel Programming |