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: 3
Default Userform Calculation

Hi -

I have a series of text boxes containing numbers that I want to
performa a simple percent difference calculation on in a user form.
The code I am using is:

txtBicTest = ((Val(txtBic2) - Val(txtBic1)) / Val(txtBic1)) * 100
txtSupTest = ((Val(txtSup2) - Val(txtSup1)) / Val(txtSup1)) * 100
txtIllTest = ((Val(txtIll2) - Val(txtIll1)) / Val(txtIll1)) * 100
txtAbdTest = ((Val(txtAbd2) - Val(txtAbd1)) / Val(txtAbd1)) * 100
txtThiTest = ((Val(txtThi2) - Val(txtThi1)) / Val(txtThi1)) * 100
txtCalTest = ((Val(txtCal2) - Val(txtCal1)) / Val(txtCal1)) * 100

In some instances not all text boxes will be complete, but this is
where I am coming up against problems. It sems that I hit a "runtime
error '6' - overflow" error for any calculation that involves a cell
that is blank. I have tried having the textboxes carry a default zero
value but the same problem occurs.

Effectively I am looking fir a way for the userform to ignore blank
cells,

ANy pointers?

Thanks
 
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
Auto calculation on a userform Greg B[_5_] Excel Programming 7 June 13th 05 02:26 PM
Auto calculation on a userform Greg B Excel Discussion (Misc queries) 0 June 13th 05 01:51 AM
UserForm Calculation Kro Excel Programming 2 April 16th 05 04:16 AM
Calculation does not appear in userform helmekki[_36_] Excel Programming 0 October 18th 04 12:48 PM
Calculation does not appear in userform helmekki[_35_] Excel Programming 1 October 18th 04 01:58 AM


All times are GMT +1. The time now is 07:58 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"