#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Find Method

Hello

I have two workbooks called Alpha and Beta, which both
have one worksheet (Sheet1).
Alpha has a string in range A1 and a command button on it.
When the user clicks the button on Alpha, I want Excel to
open Beta and do a 'Find' in the Column A of Beta, for the
string that is in range A1 of Alpha.

If the string is found on Beta, then I want to
activate/select the cell two columns along on the same
row, offset(0,2), else if it doesn't find it then do
nothing.

This is my code so far which doesn't work.

Private Sub Commandbutton1_Click()
Workbooks.Open "path to Beta"
With ActiveWorkBook.Sheet1.Columns(1)
Set C = .Find(What:=ThisWorkBook.Sheet1.Range("A1"))
If Not c is Nothing


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default rest of code

Sorry I pressed tab trying to indent code which sent it by
mistake.

Here is all the code.

Private Sub Commandbutton1_Click()
Workbooks.Open "path to Beta"
With ActiveWorkBook.Sheet1.Columns(1)
Set C = .Find(What:=ThisWorkBook.Sheet1.Range("A1"))
If Not c is Nothing
c.address.offset(0,2).activate
end if
end with
end sub

-----Original Message-----
Hello

I have two workbooks called Alpha and Beta, which both
have one worksheet (Sheet1).
Alpha has a string in range A1 and a command button on it.
When the user clicks the button on Alpha, I want Excel to
open Beta and do a 'Find' in the Column A of Beta, for

the
string that is in range A1 of Alpha.

If the string is found on Beta, then I want to
activate/select the cell two columns along on the same
row, offset(0,2), else if it doesn't find it then do
nothing.

This is my code so far which doesn't work.

Private Sub Commandbutton1_Click()
Workbooks.Open "path to Beta"
With ActiveWorkBook.Sheet1.Columns(1)
Set C = .Find(What:=ThisWorkBook.Sheet1.Range("A1"))
If Not c is Nothing


.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default rest of code

Private Sub Commandbutton1_Click()
Workbooks.Open "path to Beta"
With ActiveWorkBook.worksheets(1).Columns(1)
Set C = .Find(What:=ThisWorkBook.worksheets(1).Range("A1") )
If Not c is Nothing
c.offset(0,2).activate
end if
end with
end sub

--
Regards,
Tom Ogilvy


"LiSa" wrote in message
...
Sorry I pressed tab trying to indent code which sent it by
mistake.

Here is all the code.

Private Sub Commandbutton1_Click()
Workbooks.Open "path to Beta"
With ActiveWorkBook.Sheet1.Columns(1)
Set C = .Find(What:=ThisWorkBook.Sheet1.Range("A1"))
If Not c is Nothing
c.address.offset(0,2).activate
end if
end with
end sub

-----Original Message-----
Hello

I have two workbooks called Alpha and Beta, which both
have one worksheet (Sheet1).
Alpha has a string in range A1 and a command button on it.
When the user clicks the button on Alpha, I want Excel to
open Beta and do a 'Find' in the Column A of Beta, for

the
string that is in range A1 of Alpha.

If the string is found on Beta, then I want to
activate/select the cell two columns along on the same
row, offset(0,2), else if it doesn't find it then do
nothing.

This is my code so far which doesn't work.

Private Sub Commandbutton1_Click()
Workbooks.Open "path to Beta"
With ActiveWorkBook.Sheet1.Columns(1)
Set C = .Find(What:=ThisWorkBook.Sheet1.Range("A1"))
If Not c is Nothing


.



Reply
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
Using Find method wade Excel Programming 3 March 3rd 04 07:05 AM
find method? CG Rosén Excel Programming 2 November 12th 03 10:30 AM
Find method example Shinichi Excel Programming 3 August 22nd 03 10:39 PM
The find method Stuart[_6_] Excel Programming 0 August 5th 03 03:14 PM
Help with the Find method Mike NG Excel Programming 3 August 4th 03 07:15 PM


All times are GMT +1. The time now is 03:21 AM.

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"