+ Reply to Thread
Results 1 to 8 of 8

Insert a decimal point

  1. #1
    Registered User
    Join Date
    10-11-2006
    Location
    Tonbridge, England
    MS-Off Ver
    2003 but seriously considering upgrading
    Posts
    36

    Insert a decimal point

    I have a cell with 5 digits in it ie 15555
    I wish to change it to 1.5555
    There are over 10,000 cells that I need to do this to. Is there a macro command that will allow me to
    select all cells in range
    insert decimal point after first digit

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by alleyb
    I have a cell with 5 digits in it ie 15555
    I wish to change it to 1.5555
    There are over 10,000 cells that I need to do this to. Is there a macro command that will allow me to
    select all cells in range
    insert decimal point after first digit
    in a cell put .0001 and Edit, Copy the cell
    Select the range and Edit, Paste Special = Multiply

    hth
    ---

    note, you can select a range by typing the address in the Name box, ie C1:C10000 <Enter>
    Last edited by Bryan Hessey; 10-11-2006 at 06:52 AM.

  3. #3
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363
    Hi Alley

    Here is a different flavor

    Sub add_decimal()

    '********
    Dim Cell As Range
    Dim R As Range
    Set R = ActiveSheet.UsedRange
    ActiveSheet.Unprotect

    For Each Cell In R
    original_value = Cell.Value
    first_number = Left(original_value, 1)
    last_number = Right(original_value, 4)
    new_value = first_number & "." & last_number
    Cell.Value = new_value
    Next
    '*********
    End Sub

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Thumbs up

    Quote Originally Posted by alleyb
    I have a cell with 5 digits in it ie 15555
    I wish to change it to 1.5555
    There are over 10,000 cells that I need to do this to. Is there a macro command that will allow me to
    select all cells in range
    insert decimal point after first digit
    Hi alleyb,

    If the length of your digits vary in length (so to speak ), then you could use this, assumming your data is in A1:A10000

    =VALUE(LEFT(A1,1)&"."&RIGHT(A1,LEN(A1)-1))

    Then drag down

    oldchippy

  5. #5
    Registered User
    Join Date
    10-11-2006
    Location
    Tonbridge, England
    MS-Off Ver
    2003 but seriously considering upgrading
    Posts
    36

    Thumbs up

    Thankyou soooooooo much. I was able to use the devide function as well. So easy when one knows how shows how much i know about maths. THANKYOU again

  6. #6
    Registered User
    Join Date
    10-11-2006
    Location
    Tonbridge, England
    MS-Off Ver
    2003 but seriously considering upgrading
    Posts
    36
    I shall play with the other variations posted by Jetted and OldChippy as they have read my mind re length of digits as well.

  7. #7
    Registered User
    Join Date
    11-23-2011
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Insert a decimal point

    almost the same situation as alleyb,
    but mine is adding a decimal point in a column of cells.
    insert a decimal point after the second number, from the right.
    ie. 123456 -> 1234.56, 78900 -> 789.00. (in laymans terms).

    thanks.

  8. #8
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Insert a decimal point

    rudygs,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

+ 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