Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
leg leg is offline
external usenet poster
 
Posts: 1
Default divide cells using macro


Hi people,

i'm trying to write a macro to divide some cells by 1000.

i have a table with the values in there, and i need to divide the
values by 1000 and put the new values in the same table. i don't know
if this is posible, but it whould be great if it is!
;)


Thank you very much!


--
leg
------------------------------------------------------------------------
leg's Profile: http://www.excelforum.com/member.php...o&userid=34931
View this thread: http://www.excelforum.com/showthread...hreadid=546650

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 329
Default divide cells using macro

Hi leg,

Unless you need to do this often, you could put 1000 into an unused cell,
select the range you want to update and use Edit|Paste Special|Values:Divide

For a macro-based solution, you could use:
Sub Divide()
Dim oCell As Range
On Error Resume Next
For Each oCell In Selection
If oCell.Value < "" Then oCell.Value = oCell.Value / 1000
Next oCell
End Sub

Cheers


"leg" wrote in message
...

Hi people,

i'm trying to write a macro to divide some cells by 1000.

i have a table with the values in there, and i need to divide the
values by 1000 and put the new values in the same table. i don't know
if this is posible, but it whould be great if it is!
;)


Thank you very much!


--
leg
------------------------------------------------------------------------
leg's Profile:

http://www.excelforum.com/member.php...o&userid=34931
View this thread: http://www.excelforum.com/showthread...hreadid=546650



  #3   Report Post  
Posted to microsoft.public.excel.programming
leg leg is offline
external usenet poster
 
Posts: 1
Default divide cells using macro


Hi, thank you very much. i'll do what you told me. Thank you very much!


--
leg
------------------------------------------------------------------------
leg's Profile: http://www.excelforum.com/member.php...o&userid=34931
View this thread: http://www.excelforum.com/showthread...hreadid=546650

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
divide cells Maggi Excel Worksheet Functions 1 February 25th 09 12:48 AM
average 2 cells (Mileage Divide by Gallons in two cells dip43 Excel Discussion (Misc queries) 1 March 31st 06 04:03 AM
how to add and divide certain cells? Day Excel Discussion (Misc queries) 1 October 3rd 05 07:31 PM
Divide one row over other row I dont wont to divide one number Rick Excel Discussion (Misc queries) 0 March 4th 05 07:13 PM
Divide Expression stops in Macro when Can't divide JUAN Excel Programming 6 May 6th 04 07:05 AM


All times are GMT +1. The time now is 10:37 AM.

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"