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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,955
Members
449,199
Latest member
Riley Johnson

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
Back
Top