Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Number Stored As Text

Here are two macros:
A) convert text numbers to numbers
B) numbers to text numbers

You were interested in the TextToNumbers macro.

Sub TextToNumbers()
' Converting text numbers to real numbers
' Using the the used range for selection of cells
'
Dim cellval As Range
Dim myRng As Range
Set myRng = ActiveSheet.UsedRange
For Each cellval In myRng
cellval = cellval.Value
Next
End Sub

Sub NumbersToText()
' Converting numbers to text numbers
' Using the the used range for selection of cells
'
Dim cellval As Range
Dim myRng As Range
Set myRng = ActiveSheet.UsedRange
For Each cellval In myRng
If WorksheetFunction.IsNumber(cellval.Value) Then
cellval = "'" & cellval.Value
End If
Next
End Sub

HTH
--
Data Hog


"Paul W Smith" wrote:

What property of a cell should I check to determine whether that cell
contains a number stored as text?

I have some cells which Excel 2007 tells me, via the office assistant, are
numbers stored as text. I want to loop through all the cells in the used
range testing for and correcting this.

Paul Smith


.

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
Number stored as text Ana via OfficeKB.com Excel Worksheet Functions 3 October 14th 09 01:05 PM
Number Stored as Text. musa.biralo Excel Programming 2 March 8th 07 09:03 PM
Number stored as text Prashwee Excel Programming 3 March 15th 06 11:22 AM
Number stored as text Andrew Clark Excel Discussion (Misc queries) 1 November 8th 05 10:25 PM
Number stored as text sueanne Excel Discussion (Misc queries) 1 March 2nd 05 10:56 PM


All times are GMT +1. The time now is 04:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"