Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default Show decimal as percent

Excel2003

I am using the following code to add a record to my collection page.

Dim LP1C1ARNU As Double
....
....
Range("D" & LRow - 1).Value = LComments1 & " " & LRun & " " & "P1C1AR" & "="
& LP1C1AR & " " & "P1C1ARNU" & "=" & LP1C1ARNU

LP1C1ARNU is from another page in percent format, but shows up in the new
cell as a Decimal.(ex P1C1ARNU=.157)
How can I show it as Percentage?(ex P1C1ARNU=15.7%)

I would also like to know how to add "alt enter" to the expression so I can
line up the values in the cell.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default Show decimal as percent

1. Finish the formula with

"P1C1ARNU" & "=" & Format(LP1C1ARNU, "0.0%")

2. For a new line, include the character vbNewLine:

.... & vbNewLine & "P1C1ARNU" & "=" & LP1C1ARNU

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Gizmo" wrote in message
...
Excel2003

I am using the following code to add a record to my collection page.

Dim LP1C1ARNU As Double
...
...
Range("D" & LRow - 1).Value = LComments1 & " " & LRun & " " & "P1C1AR" &
"="
& LP1C1AR & " " & "P1C1ARNU" & "=" & LP1C1ARNU

LP1C1ARNU is from another page in percent format, but shows up in the new
cell as a Decimal.(ex P1C1ARNU=.157)
How can I show it as Percentage?(ex P1C1ARNU=15.7%)

I would also like to know how to add "alt enter" to the expression so I
can
line up the values in the cell.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default Show decimal as percent

vbNewLine is adding a box symbol to my text. I tried using Chr (10) instead
and that works better. No extra characters.

Cell contents from record sheet:
Testing New Code that adds percent symbol to record and alignes text into 6
lines
Run #27
P1C1AR=10000 P1C1ARNU=4.22% P1C1K=500.84% P1C1RNG=667
P1C2AR=10000 P1C2ARNU=4.22% P1C2K=500.84% P1C2RNG=1000
P2C1AR=0 P2C1ARNU=0.00% P2C1K=0.00% P2C1RNG=0
P2C2AR=10000 P2C2ARNU=4.22% P2C2K=500.84% P2C2RNG=1000
P3C1AR=0 P3C1ARNU=0.00% P3C1K=0.00% P3C1RNG=0
P3C2AR=10000 P3C2ARNU=4.22% P3C2K=500.84% P3C2RNG=1000


OK. I just discovered that when I tried to paste an example of the extra
characters into this reply, they were gone. They still show on my record
sheet though.

I'll describe what i'm seeing:
When looking at the text in the cell, i see a verticle line one the end of
each row of text.
When looking at the formula bar with the cell selected I see a small box at
the end of each row of text.

Does this make any sense?

"Jon Peltier" wrote:

1. Finish the formula with

"P1C1ARNU" & "=" & Format(LP1C1ARNU, "0.0%")

2. For a new line, include the character vbNewLine:

.... & vbNewLine & "P1C1ARNU" & "=" & LP1C1ARNU

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Gizmo" wrote in message
...
Excel2003

I am using the following code to add a record to my collection page.

Dim LP1C1ARNU As Double
...
...
Range("D" & LRow - 1).Value = LComments1 & " " & LRun & " " & "P1C1AR" &
"="
& LP1C1AR & " " & "P1C1ARNU" & "=" & LP1C1ARNU

LP1C1ARNU is from another page in percent format, but shows up in the new
cell as a Decimal.(ex P1C1ARNU=.157)
How can I show it as Percentage?(ex P1C1ARNU=15.7%)

I would also like to know how to add "alt enter" to the expression so I
can
line up the values in the cell.




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default Show decimal as percent

Change vbNewLine to vbLf. vbNewLine combines a carriage return (vbCr) and a
line feed (vbLf), but all you need is vbLf. Sorry.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Gizmo" wrote in message
...
vbNewLine is adding a box symbol to my text. I tried using Chr (10)
instead
and that works better. No extra characters.

Cell contents from record sheet:
Testing New Code that adds percent symbol to record and alignes text into
6
lines
Run #27
P1C1AR=10000 P1C1ARNU=4.22% P1C1K=500.84% P1C1RNG=667
P1C2AR=10000 P1C2ARNU=4.22% P1C2K=500.84% P1C2RNG=1000
P2C1AR=0 P2C1ARNU=0.00% P2C1K=0.00% P2C1RNG=0
P2C2AR=10000 P2C2ARNU=4.22% P2C2K=500.84% P2C2RNG=1000
P3C1AR=0 P3C1ARNU=0.00% P3C1K=0.00% P3C1RNG=0
P3C2AR=10000 P3C2ARNU=4.22% P3C2K=500.84% P3C2RNG=1000


OK. I just discovered that when I tried to paste an example of the extra
characters into this reply, they were gone. They still show on my record
sheet though.

I'll describe what i'm seeing:
When looking at the text in the cell, i see a verticle line one the end of
each row of text.
When looking at the formula bar with the cell selected I see a small box
at
the end of each row of text.

Does this make any sense?

"Jon Peltier" wrote:

1. Finish the formula with

"P1C1ARNU" & "=" & Format(LP1C1ARNU, "0.0%")

2. For a new line, include the character vbNewLine:

.... & vbNewLine & "P1C1ARNU" & "=" & LP1C1ARNU

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Gizmo" wrote in message
...
Excel2003

I am using the following code to add a record to my collection page.

Dim LP1C1ARNU As Double
...
...
Range("D" & LRow - 1).Value = LComments1 & " " & LRun & " " & "P1C1AR"
&
"="
& LP1C1AR & " " & "P1C1ARNU" & "=" & LP1C1ARNU

LP1C1ARNU is from another page in percent format, but shows up in the
new
cell as a Decimal.(ex P1C1ARNU=.157)
How can I show it as Percentage?(ex P1C1ARNU=15.7%)

I would also like to know how to add "alt enter" to the expression so I
can
line up the values in the cell.






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
Pivottable: Show value as a percent of Subtotal Ted M H Excel Discussion (Misc queries) 10 May 10th 08 04:57 AM
Show Percent changes christen Charts and Charting in Excel 1 April 25th 07 03:50 PM
How do you show percent changes with color shading? Manesa Charts and Charting in Excel 1 December 22nd 06 07:30 PM
How do you show percent changes? Manesa Charts and Charting in Excel 0 December 22nd 06 07:01 PM
How to calculate and then show up as a percent? Amuse Excel Worksheet Functions 1 July 10th 05 10:19 PM


All times are GMT +1. The time now is 04:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"