Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Find text string within a named range

Hi all,

I'm trying to find a text string using a named range as the searching area
but it doesn't work:

Sub names()
Dim RngToSearch As Name
Dim RngFound As Range
Set RngToSearch = ActiveWorkbook.names("tipos_dcto")

c = ActiveCell.Value

Set RngFound = RngToSearch.Find(c)

If RngFound Is Nothing Then
MsgBox "xxx"
Else

End If

End Sub

Any Ideas??

Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Find text string within a named range

Set RngToSearch = ActiveWorkbook.Range("tipos_dcto")


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"AshMorK" wrote in message
...
Hi all,

I'm trying to find a text string using a named range as the searching area
but it doesn't work:

Sub names()
Dim RngToSearch As Name
Dim RngFound As Range
Set RngToSearch = ActiveWorkbook.names("tipos_dcto")

c = ActiveCell.Value

Set RngFound = RngToSearch.Find(c)

If RngFound Is Nothing Then
MsgBox "xxx"
Else

End If

End Sub

Any Ideas??

Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Find text string within a named range

Thnks Bob x ur help. But although it makes reference to the named range, the
sub still can't find anything. And returns a "run time error '438': Objet
doesn't support this property or method".

Thanks.

"Bob Phillips" wrote:

Set RngToSearch = ActiveWorkbook.Range("tipos_dcto")


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"AshMorK" wrote in message
...
Hi all,

I'm trying to find a text string using a named range as the searching area
but it doesn't work:

Sub names()
Dim RngToSearch As Name
Dim RngFound As Range
Set RngToSearch = ActiveWorkbook.names("tipos_dcto")

c = ActiveCell.Value

Set RngFound = RngToSearch.Find(c)

If RngFound Is Nothing Then
MsgBox "xxx"
Else

End If

End Sub

Any Ideas??

Thanks in advance.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Find text string within a named range

change
Dim RngToSearch As Name

to
Dim RngToSearch As Range

and then try this
Set RngToSearch = ActiveWorkbook.names("tipos_dcto").RefersToRange
Set RngFound = RngToSearch.Find(c)

Regards,
Peter T

"AshMorK" wrote in message
...
Thnks Bob x ur help. But although it makes reference to the named range,

the
sub still can't find anything. And returns a "run time error '438': Objet
doesn't support this property or method".

Thanks.

"Bob Phillips" wrote:

Set RngToSearch = ActiveWorkbook.Range("tipos_dcto")


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my

addy)

"AshMorK" wrote in message
...
Hi all,

I'm trying to find a text string using a named range as the searching

area
but it doesn't work:

Sub names()
Dim RngToSearch As Name
Dim RngFound As Range
Set RngToSearch = ActiveWorkbook.names("tipos_dcto")

c = ActiveCell.Value

Set RngFound = RngToSearch.Find(c)

If RngFound Is Nothing Then
MsgBox "xxx"
Else

End If

End Sub

Any Ideas??

Thanks in advance.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Find text string within a named range

ActiveWorkbook (and Workbook objects generally) don't have a Range
method. You need either to change it to
ActiveWorksheet.Range("tipos_dicto")
or to use Peter T's suggestion of
ActiveWorkbook.names("tipos_dcto").RefersToRange


On Dec 6, 5:28 pm, AshMorK wrote:
Thnks Bob x ur help. But although it makes reference to the named range, the
sub still can't find anything. And returns a "run time error '438': Objet
doesn't support this property or method".

Thanks.



"Bob Phillips" wrote:
Set RngToSearch = ActiveWorkbook.Range("tipos_dcto")


--
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)


"AshMorK" wrote in message
...
Hi all,


I'm trying to find a text string using a named range as the searching area
but it doesn't work:


Sub names()
Dim RngToSearch As Name
Dim RngFound As Range
Set RngToSearch = ActiveWorkbook.names("tipos_dcto")


c = ActiveCell.Value


Set RngFound = RngToSearch.Find(c)


If RngFound Is Nothing Then
MsgBox "xxx"
Else


End If


End Sub


Any Ideas??


Thanks in advance.- Hide quoted text -


- Show quoted text -




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Find text string within a named range

Thanks Peter, It works perfectly now!!!

"Peter T" wrote:

change
Dim RngToSearch As Name

to
Dim RngToSearch As Range

and then try this
Set RngToSearch = ActiveWorkbook.names("tipos_dcto").RefersToRange
Set RngFound = RngToSearch.Find(c)

Regards,
Peter T

"AshMorK" wrote in message
...
Thnks Bob x ur help. But although it makes reference to the named range,

the
sub still can't find anything. And returns a "run time error '438': Objet
doesn't support this property or method".

Thanks.

"Bob Phillips" wrote:

Set RngToSearch = ActiveWorkbook.Range("tipos_dcto")


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my

addy)

"AshMorK" wrote in message
...
Hi all,

I'm trying to find a text string using a named range as the searching

area
but it doesn't work:

Sub names()
Dim RngToSearch As Name
Dim RngFound As Range
Set RngToSearch = ActiveWorkbook.names("tipos_dcto")

c = ActiveCell.Value

Set RngFound = RngToSearch.Find(c)

If RngFound Is Nothing Then
MsgBox "xxx"
Else

End If

End Sub

Any Ideas??

Thanks in advance.







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
Find text in a string that matches value(s) in a range [email protected] Excel Programming 8 March 15th 06 06:32 PM
Find the POSITION IN A RANGE of text in a string that matches value(s) in a range Cornell1992 Excel Programming 0 March 14th 06 07:19 PM
Retrieving range string from named range clapper Excel Programming 4 October 13th 05 03:09 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM
Setting named range in VBA- how to set as formula/reference instead of text string? Keith R[_3_] Excel Programming 1 July 28th 03 10:26 PM


All times are GMT +1. The time now is 03:31 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"