Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable as percent
Hi everyone,
I have a button that my users can push that will display a message box that is linked to a cell with a percent value in it. My problem is that when the user presses the button the msgbox say: The value of column x is: .158765224 I want this to say, " The value of column x is 15.8%" but i don't know how to declare my variable properly to do so. Any help would be appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable as percent
You can do it in the message box response:
MsgBox "The value of column x is " & Format(LinkedCell, "00.0%") If you only want whole percentage then make it "00%". Substitute the actual cell reference for LinkedCell. "James C." wrote: Hi everyone, I have a button that my users can push that will display a message box that is linked to a cell with a percent value in it. My problem is that when the user presses the button the msgbox say: The value of column x is: .158765224 I want this to say, " The value of column x is 15.8%" but i don't know how to declare my variable properly to do so. Any help would be appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable as percent
MsgBox Format(Range("B1").Value, "0.0%")
"James C." wrote: Hi everyone, I have a button that my users can push that will display a message box that is linked to a cell with a percent value in it. My problem is that when the user presses the button the msgbox say: The value of column x is: .158765224 I want this to say, " The value of column x is 15.8%" but i don't know how to declare my variable properly to do so. Any help would be appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
The first 25 percent | Excel Worksheet Functions | |||
percent of a fixed and variable number | Excel Discussion (Misc queries) | |||
Using Percent | New Users to Excel | |||
Formatting a number to look like a Percent without a percent sign | Excel Discussion (Misc queries) | |||
Percent Format without Percent Sign | Excel Programming |