Find command

redback

New Member
Joined
May 21, 2002
Messages
31
Any help with looking up a value(Jeff) within a range of cells(A1:D1) and making that cell active using VB6.

Below is the beginning of the code which opens the excel documnet via VB. The part I'm having trouble with is what would go after this. Finding a cell value within a selected range and making that cell active.

Thanks

'file is already open from load procedure, calling from background
Set oBook = GetObject("C:mooseform.xls")
'make sheet 1 of file obook active
oBook.Worksheets(1).Activate
Set oSheet = oBook.Worksheets(1)
This message was edited by redback on 2002-11-01 14:28
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Damon Ostrander

MrExcel MVP
Joined
Feb 17, 2002
Messages
4,239
Hi RedBack,

I don't have VB6 handy to verify this, but I believe it should simply be:

'file is already open from load procedure, calling from background
Set oBook = GetObject("C:mooseform.xls")
'make sheet 1 of file obook active
oBook.Worksheets(1).Activate
Set oSheet = oBook.Worksheets(1)
oSheet.[a1:d1].Find("Jeff", LookIn:=xlValues, lookat:=xlPart).Activate
 

Forum statistics

Threads
1,144,360
Messages
5,723,903
Members
422,526
Latest member
edminty84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top