Cell.find

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using Cells.FindSome one said to try "x1part
but "Part" finds any cell that have the letters
I type. I want to find the cell with the first few letters
in the right order
if I want to find "co" and the list has Comstat and Botco
in it I dont want to find the Botco

oldjay
 
Use
xlWhole and make you search target "co*"

the second letter in xlWhole is an L, not a one.
 
When you use "xlWhole" it doesn't return anything because
there is no cell in my list with just "co"
When you use xlPart it returns the first cell that has
a "co" any where in the name. I want it to look for the
cell that starts out with a "co"

I am using l(L) not 1(one)
 
How about this:

To find cells that match more complicated patterns, use a For Each...Next
statement with the Like operator. For example, the following code searches
for all cells in the range A1:C5 that use a font whose name starts with the
letters "Cour". When Microsoft Excel finds a match, it changes the font to
Times New Roman.

For Each c In [A1:C5]
If c.Font.Name Like "Cour*" Then
c.Font.Name = "Times New Roman"
End If
Next
 
I am using l(L)
If I am searching for "co" with "Whole" I get nothing
because I don't have an entry named "co". using "Part" I
get the first entry that has a "co" any where in the name.
I just want to look at the first 2 letters only
 
Hi
you have to add the '*' in your search criteria. so search for 'co*'
instead of searching for 'co'
 
I am using l(L) not 1(one)

? mid("x1Whole",2,1) = "1"
True

Why isn't this a surprise?
 
Again, take a few moments and actually read the answer. The answer was not
to search for "co". It was to search for "co*" in combination with using
xlwhole. This will solve the problem you describe.

If you are using l(L), then you probably should not post it using 1 (one)

What you posted compared to what is correct.
x1part
xlpart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top