ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find an Alphanumeric in across columns (https://www.excelbanter.com/excel-programming/419177-find-alphanumeric-across-columns.html)

ogopogo5

Find an Alphanumeric in across columns
 
I was helped by Chip in getting a code that will find an alphanumeric
across columns. Having columns C5 to F5 with numbers or texts and have
G5 with a alphanumeric.

It is possible to rewrite the following code without the loop code?

'This code is to find an alphanumeric to the right column
Sub AAA()
Dim R As Range
Set R = Range("C1") '<<< 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
R.Select

End Sub


Ogopogo5

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


All times are GMT +1. The time now is 08:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com