S
S Shipley
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
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