Alphanumeric Recognition

N

NewToVB

I'm using Visual Studio/Visual Basic which is very similiar to VBA. I need
for my program to recognize when a cell has 8 alphanumeric characters in
column A, and if it doesn't have 8 alphanumeric characters to delete the
entire row. Any ideas on how to do this? Thanks in advance! :)
 
R

Rick Rothstein \(MVP - VB\)

You haven't told us much or given us code where we create a solution for you
using your own variable names; so I'll make the assumption that you already
know how to delete a row and are just not sure how to insure your cell's
content is exactly 8 alphanumeric characters.

If Not Text Like Replace(String(8, "Z"), "Z", "[a-zA-Z0-9]") Then
' Text is **not** made up of 8 alphanumeric characters...
' so put your delete row line here
End If

Rick
 
N

NewToVB

Yes I already know how to delete rows and all, just wasn't sure about the
alphanumeric part, sorry about that. I'll try this thank you! :)

Rick Rothstein (MVP - VB) said:
You haven't told us much or given us code where we create a solution for you
using your own variable names; so I'll make the assumption that you already
know how to delete a row and are just not sure how to insure your cell's
content is exactly 8 alphanumeric characters.

If Not Text Like Replace(String(8, "Z"), "Z", "[a-zA-Z0-9]") Then
' Text is **not** made up of 8 alphanumeric characters...
' so put your delete row line here
End If

Rick


NewToVB said:
I'm using Visual Studio/Visual Basic which is very similiar to VBA. I
need
for my program to recognize when a cell has 8 alphanumeric characters in
column A, and if it doesn't have 8 alphanumeric characters to delete the
entire row. Any ideas on how to do this? Thanks in advance! :)
 

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

Top