Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Find text numbers

How do I find numbers formated as text in a sheet?
Need help for vba as well as without vba.

Thanks
Jan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 212
Default Find text numbers

Through VBA code:
The below code will find the cells having numbers but formatted as text, in
Sheet1 and will add comment to such cells.
It is assumed that none of such cells already have a comment.
Sub TextNumber()
For Each cell In Sheet1.UsedRange
If IsNumeric(cell.Value) And cell.NumberFormat = "@" Then
cell.AddComment "Text Number!"
cell.Comment.Shape.Height = 12
cell.Comment.Shape.Width = 55
cell.Comment.Visible = True
End If
Next cell
End Sub

Without VBA: I don't understand this fully. But following will help.
By default if cell has a numeric data and is formatted either as General or
Number,
the cell horizontal alignment is right.
If it is formatted as text, the alignment is left.
So by just looking at the cells you can determine, if the cell contains a
number and
is aligned left, the cell is formatted as text.
This is assuming that the user has not change the default horizontal
alignment, either to right for the
text formatted cells or to left for the general or number formatted cells.

Otherwise you have to see the cell properties for each cells conataining
numeric data.

Sharad

"Jan" wrote in message
...
How do I find numbers formated as text in a sheet?
Need help for vba as well as without vba.

Thanks
Jan



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
Find the maximum value in a row or column with text and numbers bengles Excel Worksheet Functions 2 November 17th 09 09:04 AM
Find All Numbers and Text in a cell jlclyde Excel Discussion (Misc queries) 3 January 26th 09 02:40 PM
Find All Numbers and Text in a cell jlclyde Excel Discussion (Misc queries) 0 January 26th 09 01:57 PM
Find $ in a string of text and return numbers Craig Excel Discussion (Misc queries) 5 September 13th 06 10:42 PM
find text in column h and total the corresponding numbers if colum adelaide Excel Discussion (Misc queries) 2 February 6th 06 04:47 AM


All times are GMT +1. The time now is 05:19 AM.

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"