Results 1 to 7 of 7
  1. #1
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Change a Whole to Decimal (2000/SR-1)

    I know I have done this before but having a senior moment <img src=/S/surrender.gif border=0 alt=surrender width=31 height=23> this morning.

    I have a number coming in from the spreadsheet like 50. In my module, I need to add a decimal to the 50 like .50 to get 50% of something. <pre>FirstJTD = (("J" & Missio - "G" & Missio) * 0.2) * "." & FirstCommAmt
    <font color=red>'NotWorking</font color=red></pre>

    Alan

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Change a Whole to Decimal (2000/SR-1)

    Do you mean something like:

    With ActiveCell
    .Value = .Value / 100
    .NumberFormat = "0.00%"
    End With
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Change a Whole to Decimal (2000/SR-1)

    How about:
    <pre>FirstJTD = (range("J" & Missio) - range("G" & Missio)) * 0.2 * FirstCommAmt/100</pre>


    Steve

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Change a Whole to Decimal (2000/SR-1)

    <img src=/S/confused.gif border=0 alt=confused width=15 height=20> How did you know which of Alan's variables were which? Getting psychic on us, Steve? <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Change a Whole to Decimal (2000/SR-1)

    I looked at his formula:
    <hr>FirstJTD = (("J" & Missio - "G" & Missio) * 0.2) * "." & FirstCommAmt<hr>

    and if I assumed that Missio was a row value and the firstCommAmt was the number he wanted I got something like (Assume Missio is 2):
    FirstJTD = (("J2" - "G2) * 0.2) * (.50 )

    Which seemed to be his question about the 50 with the decimal, so I just made it all work assuming the others were ranges. I will wait for confirmation, before you start calling me psychic.

    Steve

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Change a Whole to Decimal (2000/SR-1)

    On further thought, your assumptions make so much sense that I may start calling you Mr. Spock.
    -John ... I float in liquid gardens
    UTC -7ąDS

  7. #7
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Change a Whole to Decimal (2000/SR-1)

    They were completely logical assumptions.

    Steve

Posting Permissions

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