Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to make excel to treat values in cell as a number?

How to make excel to treat values in cell as a number?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to make excel to treat values in cell as a number?

set cell = Range("B9")
cell.NumberFormat = "General"
cell.Value = cell.Value

' or for extra assurance

cell.Value = cdbl(cell.Value)

--
Regards,
Tom Ogilvy


"Peri" wrote in message news:op.szt6nxbky8ffpb@mcs...
How to make excel to treat values in cell as a number?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default How to make excel to treat values in cell as a number?

Changing the format of a cell from text to number, or from
number to text will not affect the actual formatting until
the cell value is reentered. F2 then Enter would cause
reentry. A macro such as TrimALL would cause reentry
http://www.mvps.org/dmcritchie/excel/join.htm#trimall
Be careful with cells containing dates.

Changing the format of a number that actually is a number
is effective immediately, as is changing the format of
a text string that is already treated as text is also immediate.

Since this is the programming group you can take care of
everything at once.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Tom Ogilvy" wrote in message ...
set cell = Range("B9")
cell.NumberFormat = "General"
cell.Value = cell.Value

' or for extra assurance

cell.Value = cdbl(cell.Value)

--
Regards,
Tom Ogilvy


"Peri" wrote in message news:op.szt6nxbky8ffpb@mcs...
How to make excel to treat values in cell as a number?






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
Can I make Excel 2003 treat blank cells as zero? Wortman Excel Discussion (Misc queries) 2 July 20th 09 04:29 PM
How can I make a Chart data series treat blanks as "Empty" cells XLADLK Charts and Charting in Excel 12 June 9th 08 10:53 PM
Force Excel To Treat A Cell As Blank MDW Excel Worksheet Functions 3 October 16th 06 09:52 PM
Getting Excel to treat merged cells as one cell when printing postitnote100 Excel Discussion (Misc queries) 1 June 24th 05 07:13 PM
Excel - treat pairs of figures differently according to values Alistair Excel Worksheet Functions 1 May 10th 05 10:31 PM


All times are GMT +1. The time now is 08:17 PM.

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"