Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Problem displaying a calculation result in a user form

I have developed a fairly simple game in Excel 2002. One feature is a
statistics box that shows the player the numbers of wins and losses and the
percentage of wins.

I have set this up using 3 text boxes each with a ControlSource link to the
sheet and cell that contains the relevant data. It works fine for the
numbers of wins and the number of losses but I keep finding that the 3rd item
hits a bug whereby the cell containing the calculation of the win percentage
somehow loses the calculation and it is replaced by an integer.

Can anyone help? Maybe there is an easier/more secure way to calculate the
win percentage from within the user form??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problem displaying a calculation result in a user form

Show the code?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"AndyRoo" wrote in message
...
I have developed a fairly simple game in Excel 2002. One feature is a
statistics box that shows the player the numbers of wins and losses and

the
percentage of wins.

I have set this up using 3 text boxes each with a ControlSource link to

the
sheet and cell that contains the relevant data. It works fine for the
numbers of wins and the number of losses but I keep finding that the 3rd

item
hits a bug whereby the cell containing the calculation of the win

percentage
somehow loses the calculation and it is replaced by an integer.

Can anyone help? Maybe there is an easier/more secure way to calculate

the
win percentage from within the user form??



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Problem displaying a calculation result in a user form

Not sure what you mean by 'show the code'. If you mean what I have written
in the Macro, it is shown below.

In the sheet the statistics are in ('stats') I have a calculation for
percentage wins as follows in cell B9:

=IF(ISERROR(100*B5/B7),0,(100*B5/B7)). In Cell B11 I have a formula to
round that to 1 decimal, =ROUND(B9,1).

In the properties box for my userform I have tried linking to both cells B9
and B11 using the ControlSource property. I have found that when I enter
Sheets!B9 (or B11 for that matter) in the section for ControlSource then the
user form picks up the figure I want it to, at first.

However after a couple of uses of the game the macro is in, I find the
figure for percentage wins no longer updates. When I investigate I find that
the formula in the calculation cells has disappeared and in its place is an
integer (not a random one, it is the calculated percentage of wins the last
time the formula worked).

I have tried stepping through the code in debugging mode but nothing goes
wrong when I step through the code, so I am baffled.

Hope that is clear, any help gratefully received.

"Bob Phillips" wrote:

Show the code?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"AndyRoo" wrote in message
...
I have developed a fairly simple game in Excel 2002. One feature is a
statistics box that shows the player the numbers of wins and losses and

the
percentage of wins.

I have set this up using 3 text boxes each with a ControlSource link to

the
sheet and cell that contains the relevant data. It works fine for the
numbers of wins and the number of losses but I keep finding that the 3rd

item
hits a bug whereby the cell containing the calculation of the win

percentage
somehow loses the calculation and it is replaced by an integer.

Can anyone help? Maybe there is an easier/more secure way to calculate

the
win percentage from within the user form??




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
Displaying a result based on user selection Emma Excel Discussion (Misc queries) 3 June 9th 09 08:08 PM
user form question: text box to display result BigPig Excel Discussion (Misc queries) 0 February 28th 06 12:33 AM
user form question: text box to display result BigPig Excel Worksheet Functions 0 February 25th 06 08:17 PM
how do i display a value in a user form as a result of a selectio. ptoddx1 Excel Programming 3 January 29th 05 04:42 PM
Displaying part of a sheet on a user form Phillip[_4_] Excel Programming 1 January 15th 04 04:20 AM


All times are GMT +1. The time now is 01:20 AM.

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"