Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find method, After parameter


I want to use a returned address as the "After" property with the Fin
method. I am having problems figuring this out. I do explaining best b
example:

First I get the address of the string I want to find (this part work
great):
With Worksheets("data").Range("G1:G3000")
Set c = .find("BH")
BHAddress = c.Address
End With

Next, I want to use BHAddress as my starting point for my new search
Here I want to search for "BA". I have tried two things (See below
both I am getting errors with:

With Worksheets("data").Range(" BHAddress :G3000")
Set c = .find("BA")
BAAddress = c.Address
End With

I get an error here with the first line: "Error 100
application-defined or object-defined error"

OR

With Worksheets("data").Range("G1:G3000")
Set c = .find("BA", BHAddress )
BAAddress = c.Address
End With
I get an error here with the second line: "Error 1004 Unable to get th
Find property of the Range class"

I thought about returning the Row and the Column separately and the
concatenating them together to make the address if it is not returne
in the proper form. I see currently it is returned as $Column$Row
Perhaps that is why I am getting problems?

I am using Excel 2000, Win 2000.

Thanks so much in advance! I am sure it is something silly

--
melisfree
-----------------------------------------------------------------------
melisfreed's Profile: http://www.excelforum.com/member.php...fo&userid=1614
View this thread: http://www.excelforum.com/showthread.php?threadid=27575

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find method, After parameter


melisfreed,


Try

With Worksheets("data").Range(BHAddress & ":" & "G3000")

HTH

Charle

--
Charle
-----------------------------------------------------------------------
Charles's Profile: http://www.excelforum.com/member.php...nfo&userid=601
View this thread: http://www.excelforum.com/showthread.php?threadid=27575

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Find method, After parameter

melisfred

I want to use a returned address as the "After" property with the Find
method. I am having problems figuring this out. I do explaining best by
example:

First I get the address of the string I want to find (this part works
great):
With Worksheets("data").Range("G1:G3000")
Set c = .find("BH")
BHAddress = c.Address
End With

Next, I want to use BHAddress as my starting point for my new search.
Here I want to search for "BA". I have tried two things (See below)
both I am getting errors with:

With Worksheets("data").Range(" BHAddress :G3000")
Set c = .find("BA")
BAAddress = c.Address
End With

I get an error here with the first line: "Error 1004
application-defined or object-defined error"


That would have to be .Range(BHAddress & ":G3000"), but your next method is
better.


OR

With Worksheets("data").Range("G1:G3000")
Set c = .find("BA", BHAddress )
BAAddress = c.Address
End With
I get an error here with the second line: "Error 1004 Unable to get the
Find property of the Range class"


The after argument takes a range object, not a string (e.g. Address).

With Worksheets("data").Range("G1:G3000")
Set c = .Find("BH")
Set c = .FindNext(c)
End With

Now c will be a range that contains the first BA after the first BH.

See here for more on the Find method

http://www.dicks-blog.com/excel/2004...nd_method.html

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com


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 in Excel passing more than 1 parameter Nick Excel Programming 3 November 2nd 04 05:56 PM
Find method Kirk Excel Programming 0 September 22nd 04 09:33 PM
Problem with the PrToFileName parameter when using the Printout method on a worksheet Prasad Vanka Excel Programming 6 May 14th 04 10:56 AM
Pass string as Parameter in OpenText method No Name Excel Programming 0 January 8th 04 06:22 AM
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 04:08 PM.

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

About Us

"It's about Microsoft Excel"