Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Variable as percent

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
James C. - 25 Mar 2008 03:51 GMT
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.
JLGWhiz - 25 Mar 2008 04:08 GMT
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.

> Hi everyone,
>
[quoted text clipped - 8 lines]
>
> Any help would be appreciated.
Mike - 25 Mar 2008 04:13 GMT
MsgBox Format(Range("B1").Value, "0.0%")

> Hi everyone,
>
[quoted text clipped - 8 lines]
>
> Any help would be appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.