View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Counting # of cells containing an apostrophe

On Mon, 18 Dec 2006 03:13:00 -0800, Bob wrote:

Ron,
The morefunc.xll add-in works great! Using the XLM.GET.CELL function tells
me that I have 100+ instances of an apostrophe in my worksheet! But when I
try to go find them using Excel's Find command, I can't find any. As the
search criteria, I used "'" (double quotes, apostrophe, double quotes). Can
you advise me as to what I'm doing wrong?


The FIND command is designed to locate text strings. As I wrote previously,
the "'" is a prefix indicating that the cell is to be treated as TEXT. Not the
same thing as a text string within a cell.

I'm not sure what you're trying to do. If you want to locate these cells and
do something to them, you could use a VBA macro.

e.g.:

======================
Sub FindApos()
Dim c As Range
Dim RngToCheck As Range

Set RngToCheck = [a1:c20]

For Each c In RngToCheck
If c.PrefixCharacter = "'" Then
c.Interior.Color = vbRed
'or do something else here
End If
Next c
End Sub
======================
--ron