LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default VBA decimal places

Dear Excel Helper

In an Excel workbook I have a worksheet and a chart.

In the worksheet in cell P1 I have worked out a value as a percentage. I
have this displayed on my chart by using the folowing within my VBA code...

ActiveChart.Shapes("Text Box 13").Select
Selection.Characters.Text = Sheets("ComboBoxRef").Range("$P$1")

Now, the problem is as follows. On my worksheet, cell P1 is formatted to
display just two decimal places i.e. it displays as 6.3. However, on my chart
it displays as 6.32203200179032. How can I get it displayed as two decimal
places on my chart?

I have tried formatting the cell P1 but it makes no difference regaring what
is displayed. It is as if VBA only displays the 'underlying' value. I have
messed about with...

application.worksheetfunction.fixed(P1,2)

and...

numberformat= "0.0"

but it seems unsatisfactory.

If there is an easy way around this please let me know.

Best Regards

Alex
 
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
decimal places narp[_2_] Excel Discussion (Misc queries) 2 May 14th 08 09:39 PM
Decimal Places Tafmutt Excel Discussion (Misc queries) 2 March 14th 07 09:22 PM
Subtracting two 2-decimal place numbers gives result 13-decimal places? [email protected] Excel Worksheet Functions 5 March 12th 07 10:38 PM
FIXED 2 DECIMAL PLACES, MUST ENTER ALL ZEROES AFTER DECIMAL POINT. SUKYKITTY Excel Discussion (Misc queries) 3 July 6th 05 01:50 PM
decimal places HB Excel Discussion (Misc queries) 4 March 15th 05 02:19 AM


All times are GMT +1. The time now is 12:10 PM.

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"