PC Review


Reply
Thread Tools Rate Thread

converting numbers

 
 
SITCFanTN
Guest
Posts: n/a
 
      5th Dec 2007
I have 8 sheets in my Excel File that has values in col E. I need to write a
macro, I'm thinking that is my best option, to divide each cell in column E
of all the sheets by 100 so the numbers that display as.

748,029.00 should display as 7,480.29
2,666,406.00 should display as 26,664.06
206,633.00 should display as 2,066.33

I tried changing the format of the cells but that didn't work, can somebody
help me with a macro to accomplish this. Thanks for your help.

 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      5th Dec 2007
the simple way of doing this is to put into column F the formula
=100*E1 and copy down the column

the copy column F and use PasteSpecial Value and paste back into column e.
You can then delte column F.

If column f has data then use any empty column.

"SITCFanTN" wrote:

> I have 8 sheets in my Excel File that has values in col E. I need to write a
> macro, I'm thinking that is my best option, to divide each cell in column E
> of all the sheets by 100 so the numbers that display as.
>
> 748,029.00 should display as 7,480.29
> 2,666,406.00 should display as 26,664.06
> 206,633.00 should display as 2,066.33
>
> I tried changing the format of the cells but that didn't work, can somebody
> help me with a macro to accomplish this. Thanks for your help.
>

 
Reply With Quote
 
liazasup@yandex.ru
Guest
Posts: n/a
 
      5th Dec 2007
in cell F

=Macros(E1)
=Macros(E2)
=Macros(E3)

Public Function Macros(value_ As Range) As Double
Dim i, r As Double
i = Replace(value_.Value, ",", "", , , vbTextCompare)
r = Val(i)
Macros = r / 100
End Function
 
Reply With Quote
 
Mark Lincoln
Guest
Posts: n/a
 
      5th Dec 2007
Unless you need to do this on a regular basis (in which case a macro
is a good idea), just do this:

Put 100 into any empty cell.

Copy that cell.

Highlight the cells you need to convert, then use Paste Special (Edit
| Paste Special, or right-click somewhere in the range and choose
Paste Special from the popup dialog). Check Formulas in the Paste
section of the dialog and Divide in the Operation section. Click OK
and voila!

Clear the cell holding the 100 value.

Mark Lincoln

On Dec 5, 9:11 am, SITCFanTN <SITCFa...@discussions.microsoft.com>
wrote:
> I have 8 sheets in my Excel File that has values in col E. I need to write a
> macro, I'm thinking that is my best option, to divide each cell in column E
> of all the sheets by 100 so the numbers that display as.
>
> 748,029.00 should display as 7,480.29
> 2,666,406.00 should display as 26,664.06
> 206,633.00 should display as 2,066.33
>
> I tried changing the format of the cells but that didn't work, can somebody
> help me with a macro to accomplish this. Thanks for your help.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting a Column of Numbers Displayed as Text to Numbers cardan Microsoft Excel Programming 4 12th Sep 2007 05:45 PM
Converting positive numbers to negative numbers =?Utf-8?B?VHJlZzY3?= Microsoft Excel Worksheet Functions 4 17th Jul 2006 03:57 PM
Converting negative numbers stored as text to numbers =?Utf-8?B?QUthbXJhbg==?= Microsoft Access 2 25th May 2006 04:03 PM
Converting negative numbers stored as text to numbers =?Utf-8?B?QUthbXJhbg==?= Microsoft Access 0 25th May 2006 03:54 PM
Converting numbers formatted as text to numbers =?Utf-8?B?QmlsbA==?= Microsoft Excel Misc 1 19th Jul 2005 07:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:56 AM.