Carlos,
That doesn't surprise me because if the textbox is a number, even though
textbox returns a string it can ad correctly.
You didn't answer my question about what was in TT and TV. If the total of
TT and Tv exceeds the textbox value then you will get an error. You should
trap the error with
Hgt = Val(TextBox1.Value)
If Hgt (TT + TV) Then
Image1.Height = Hgt - (TT + TV)
Else
MsgBox "Invalid height for image"
With TextBox1
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With
End If
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
"CAA " wrote in message
...
Still not right?
I run the form and enter, say 900 in the text box. When the value of TT
& TV = 0 (just text positions if they exist) all is ok. Then when TT is
not 0 all go's to pot.
Says cannot set height, so i look at the value of HGT and it is 0, why
would it be 0?
using
Hgt = Val(textbox1.value)
I have declared Hgt, TT and TV as Long types.
should i be decalring another type to hold the result of Hgt - TT -
TV?
It seems a simple thing, why is it thrashing my head!?
Thanks for looking
CAA
---
Message posted from http://www.ExcelForum.com/