Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Find Method question

Good Morning Group,

Have following problem with the Find Method in the code below.
If the ActiveSheet Range contains values like 1 and 11 (or 2 and 22 etc)
the code below does not find the value 1 but always the value 11.
The search range is formatted as "general".

Thankful for any hints.

Brgds

CG Rosén
--------------------------------------------------------------------------
For I = 1 to 6

With ActiveSheet.Range("A" & I & ":" & "X" & I)
Set k = .Find(TextBox1, LookIn:=xlValues)
If k Is Nothing Then
k = 0
End If
End With

Next I


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Find Method question

CG,

That should not be a problem. Are you sure that the value you are looking
for is just a 1, and doesn't have leading or trailing spaces? Step through
the code and do a ?LEN(Textbox1) in the immediate window when you get to
the Find statement.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"CG Rosén" wrote in message
...
Good Morning Group,

Have following problem with the Find Method in the code below.
If the ActiveSheet Range contains values like 1 and 11 (or 2 and 22 etc)
the code below does not find the value 1 but always the value 11.
The search range is formatted as "general".

Thankful for any hints.

Brgds

CG Rosén
--------------------------------------------------------------------------
For I = 1 to 6

With ActiveSheet.Range("A" & I & ":" & "X" & I)
Set k = .Find(TextBox1, LookIn:=xlValues)
If k Is Nothing Then
k = 0
End If
End With

Next I




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 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
The Find Method Dick Kusleika Excel Programming 3 July 16th 03 07:59 PM
The Find Method Brad[_7_] Excel Programming 0 July 16th 03 03:23 PM


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