Thread
:
How to test if the end character of a string is within a user-definedlist?
View Single Post
#
7
Posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
Posts: 10,124
How to test if the end character of a string is within a user-defined list?
try isnumERIC and post back
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"T2net" wrote in message
...
Unfortunately this gives as a result only 1 and 2 according to the
list I provided. I made a mix between your answers. I ended up with
this macro:
Sub test_number_and_a()
mc = 2
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
x = Cells(i, mc)
If Right(x, 1) < "a" And Not (IsNumber(x)) Then Rows(i).Delete
Next i
End Sub
Unfortunately, I have a compiling error on Not (IsNumber(x)) . Any
idea?
Thanks, T2net
On 22 fév, 14:51, "Don Guillett" wrote:
Given your example
Sub leavenumberandA()
mc = 1
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
x = Cells(i, mc)
If Len(x) 1 And Right(x, 1) < "a" Then Rows(i).Delete
Next i
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"T2net" wrote in
message
...
On 22 fév, 12:57, Pete_UK wrote:
I think you need to give some further examples showing some which
would fail your criteria, as it looks to me as if they would all pass.
Pete
On Feb 22, 11:22 am, T2net wrote:
Hello,
I have a list in column which may look like
1
2
3a
3b
3g
56
67a
67c
I would like to keep only the rows which contains numbers or numbers +
a character.
Any idea?
Thanks, T2net
MS
VB
6.3, Excel 2003, Win2000- Masquer le texte des messages
pr
écédents -
- Afficher le texte des messages
pr
écédents -
Oops sorry I meant the "a" character.
I want to keep the rows with numbers (like 1,2, 56) and those with
"a" (3a, 67a) and not the others
T2net- Masquer le texte des messages
pr
écédents -
- Afficher le texte des messages
pr
écédents -
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett