Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Find an Alphanumeric in a column

Still there a way to write in VB to find a alphanumeric in column. I.E.
Columns C5, D5, E5, F5 all have numbers but in G5 is alphanumeric {for
example PT22}. It will skip the cells that have the number but will find
and select the alphanumeric.

Ogopogo5

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Find an Alphanumeric in a column

You can adapt the following code.

Sub AAA()
Dim R As Range
Set R = Range("A1") '<<< SET TO YOUR CELL

Do Until False
If Len(R.Text) 0 Then
If IsNumeric(R.Text) = False Then
Exit Do
Else
If R.Column < R.Worksheet.Columns.Count Then
Set R = R(1, 2)
Else
Set R = Nothing
Exit Do
End If
End If
Else
If R.Column < R.Worksheet.Columns.Count Then
Set R = R(1, 2)
Else
Set R = Nothing
Exit Do
End If
End If
Loop

If R Is Nothing Then
MsgBox "No non-blank alpha numeric cell found."
Else
MsgBox "Alpha Cell: " & R.Address
End If
End Sub

The variable R will be set to the first non-blank, non-numeric cell.
If no such cell is found by the last column, R has the value Nothing,
indicating that no cell was found.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Mon, 20 Oct 2008 13:38:28 -0700, ogopogo5
wrote:

Still there a way to write in VB to find a alphanumeric in column. I.E.
Columns C5, D5, E5, F5 all have numbers but in G5 is alphanumeric {for
example PT22}. It will skip the cells that have the number but will find
and select the alphanumeric.

Ogopogo5

*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Find an Alphanumeric in a column

Thank you very much Chip. Instead of the MsgBox, is there a way to
select the cell itself?

Ogopogo5

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Find an Alphanumeric in a column

Hi Chip, please ignore my previous reply. I was able to make it select
by changing MsgBox "Alpha Cell: " & R.Address to R.Select. Thank very
much for your help

Ogopogo5

*** Sent via Developersdex http://www.developersdex.com ***
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
Search an alphanumeric in a column and return true/false 2226 Excel Worksheet Functions 9 January 6th 09 09:17 AM
find a alphanumeric in a list 2226 Excel Worksheet Functions 2 January 5th 09 10:17 AM
Sort a text column that contains alphanumeric Maureen Excel Discussion (Misc queries) 1 July 3rd 08 12:12 AM
Find largest alphanumeric value matching alpha criteria in databas Alison Excel Worksheet Functions 7 August 4th 05 06:59 PM
I need to randomize a column of alphanumeric employee ID's for a . topkick Excel Worksheet Functions 9 November 9th 04 02:38 PM


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