Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Giz Giz is offline
external usenet poster
 
Posts: 15
Default find and select all cells with a alphabetic character

I am trying to create a macro that finds, on a worksheet, all cells with an
alphabetic character (i.e. "a" or "b" or "c", etc.), and then selects them.
ANy ideas??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default find and select all cells with a alphabetic character

Try this

Sub buildrange()
Dim rng As Range
Dim cell As Range
Set rng = Nothing
For Each cell In ActiveSheet.UsedRange
If Not (IsNumeric(cell.Value)) Then 'Changed for previous post
If rng Is Nothing Then
Set rng = cell
Else
Set rng = Union(rng, cell)
End If
End If
Next cell
If Not rng Is Nothing Then
rng.Select
End If
End Sub
--
HTH...

Jim Thomlinson


"Giz" wrote:

I am trying to create a macro that finds, on a worksheet, all cells with an
alphabetic character (i.e. "a" or "b" or "c", etc.), and then selects them.
ANy ideas??

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default find and select all cells with a alphabetic character

Building on Gary's reply to your first post

Sub buildrange()
Dim rng As Range
Dim cell As Range
Set rng = Nothing
For Each cell In ActiveSheet.UsedRange
If cell.Value = "a" or cell.Value = "b" or _
cell.Value = "c" or cell.Value = "d" Then
If rng Is Nothing Then
Set rng = cell
Else
Set rng = Union(rng, cell)
End If
End If
Next cell
If Not rng Is Nothing Then
rng.Select
End If
End Sub

if you mean all cells containing a string constants

Cells.specialCells(xlConstants,xlTextValues).Selec t

--
Regards,
Tom Ogilvy



"Giz" wrote in message
...
I am trying to create a macro that finds, on a worksheet, all cells with

an
alphabetic character (i.e. "a" or "b" or "c", etc.), and then selects

them.
ANy ideas??



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
How to find the highest name in an alphabetic list? Grd Excel Worksheet Functions 5 July 3rd 08 07:59 PM
How to select a list of text, and then put it in a row alphabetic. B-Rad Excel Discussion (Misc queries) 1 June 4th 07 09:28 PM
To select cells containing a certain character ? Mark246 Excel Discussion (Misc queries) 5 January 10th 07 09:42 PM
Formula to find highest alphabetic name in a list of names Grd Excel Worksheet Functions 6 March 15th 06 02:44 AM
Add a alphabetic character to the beginning of an entire column of Karise Excel Discussion (Misc queries) 1 August 18th 05 10:24 PM


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