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

1. ## 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>

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

Do you mean something like:

With ActiveCell
.Value = .Value / 100
.NumberFormat = "0.00%"
End With

3. ## 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. ## 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>

5. ## 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. ## 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.

7. ## 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
•