+ Reply to Thread
Results 1 to 3 of 3

divide cells using macro

  1. #1
    Registered User
    Join Date
    05-30-2006
    Posts
    6

    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!

  2. #2
    macropod
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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. #3
    Registered User
    Join Date
    05-30-2006
    Posts
    6
    Hi, thank you very much. i'll do what you told me. Thank you very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1