LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find in another worksheet and copy to original worksheet. Reinie Excel Programming 0 August 5th 09 09:30 PM
how to find and unlink current worksheet from old worksheet kmjmail Excel Discussion (Misc queries) 3 January 12th 09 10:52 PM
Find Max Value in WorkSheet Corey Excel Worksheet Functions 11 January 14th 07 11:00 PM
Find worksheet cottage6 Excel Programming 8 April 21st 05 05:43 PM
find last row on a worksheet tracey Excel Programming 3 February 3rd 04 10:39 PM


All times are GMT +1. The time now is 11:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"