#1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 17
Default number

i want to check to see if a cell or a number of cells
contain a number or a string. can anyone help me with
that?

thanx a lot
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default number

You can use the IsNumeric function to determine if the
expression in the cell can be evaluated to a number, and
the For..Next construction to loop through all cells in
the selected range. For example, the following counts the
number of numeric cells in the range and displays a
message box with the result:

Sub CountNumeric()
Dim Cell As Range
Dim intCount As Integer
intCount = 0
For Each Cell In Selection
If IsNumeric(Cell) Then
intCount = intCount + 1
End If
Next
MsgBox "There are " & intCount & " numeric cells in the
selected range."
End Sub

HTH
Kevin Sprinkel

-----Original Message-----
i want to check to see if a cell or a number of cells
contain a number or a string. can anyone help me with
that?

thanx a lot
.

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
Sumif number is greater than a number but less than another number lulu151 Excel Discussion (Misc queries) 2 May 7th 10 07:12 PM
How can I click on a telephone number in an Excel 2002 spreadsheet, and have the number dialed? jbclem Excel Discussion (Misc queries) 2 August 13th 09 01:57 AM
How to calculate number of occurencies of a specific number number Stefan Excel Discussion (Misc queries) 4 September 8th 08 08:33 AM
Formula to change scientific number to regular number or text Compare Values Excel Discussion (Misc queries) 2 August 23rd 07 06:10 PM
Rounding a number to a multiple quantity that adds to a fixed total number wjlo Excel Worksheet Functions 1 November 9th 04 04:43 PM


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