Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Changing format of cells

I have a spreadsheet that is exported from another system. The numbers
in it are exported as text with leading zeros. I can convert this text
to numbers from within the worksheet using the function =value(), but I
want my macro to convert them automatically. I do not want to move the
data from the current cells, just convert it to numbers so that it can
be totalled. What is the correct command/syntax for this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default Changing format of cells

Try something like this using DB as the range you want to change:

Dim CellRge as object
For Each Cellrge in DB
cellrge = val(cellrge)
Next CellRge







"RobH" wrote in message
ups.com...
I have a spreadsheet that is exported from another system. The numbers
in it are exported as text with leading zeros. I can convert this text
to numbers from within the worksheet using the function =value(), but I
want my macro to convert them automatically. I do not want to move the
data from the current cells, just convert it to numbers so that it can
be totalled. What is the correct command/syntax for this?



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
How can I refresh cells after changing the format? JLMHoss Excel Discussion (Misc queries) 3 April 21st 23 10:09 PM
Linking cells with changing format Wombat Excel Discussion (Misc queries) 3 October 6th 09 04:08 PM
Format of Cells Changing on thier own GCC Excel Discussion (Misc queries) 1 July 16th 09 05:38 PM
Format of cells Changing on thier own GCC Excel Worksheet Functions 0 July 16th 09 02:09 PM
Changing Cells format using VBA Amir Excel Programming 2 June 10th 05 12:40 PM


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