P
Paul Mullan
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
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