Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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
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
The first 25 percent PAL Excel Worksheet Functions 3 October 20th 09 02:51 PM
percent of a fixed and variable number Lorne Excel Discussion (Misc queries) 7 June 8th 08 08:43 PM
Using Percent Traci New Users to Excel 2 March 23rd 08 03:01 AM
Formatting a number to look like a Percent without a percent sign David Iacoponi Excel Discussion (Misc queries) 2 September 15th 05 06:35 PM
Percent Format without Percent Sign jstrater Excel Programming 1 April 29th 04 07:28 AM


All times are GMT +1. The time now is 03:24 PM.

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

About Us

"It's about Microsoft Excel"