View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Limits on Userform textbox

This seems to be an example whereby the scrollbar is used to set the textbox
value. Slide it up or down and the textbox changes.

It seems totally unnecessary for your app, get rid of it and the three
events.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"radarguy " wrote in message
...
Hi Guys,
I am somewhat new to advanced VBA but trying real hard. One concept
that is the hardest for me to understand and rectify is error trapping.
I am trying to make a Userform to change a Spreadsheet cell and
display the change in a "textbox" that I can also just type in a
number. The code I have come up with from Excel help is below. It
works ok until I try to edit the textbox with a number greater than the
limit of the scrollbar. Can anyone help me? Also, If anyone can give
me a simplified explanation of what exactly the three scrollbar
commands are doing that would be great!

I've attached the file for easy editing.

Thanks,
Russ

Public Azimuth As Integer

Private Sub cmdContinue_Click()
Unload Me
End Sub

Private Sub txtAzimuth_Change()
scrAzimuth.Value = txtAzimuth.Value
End Sub

Private Sub UserForm_Initialize()
scrAzimuth.Min = 0
scrAzimuth.Max = 360
scrAzimuth.Value = 180
End Sub

Private Sub scrAzimuth_Change()
txtAzimuth.Value = (scrollsaved + scrAzimuth.Value)
Range("b2") = txtAzimuth.Value
End Sub

Private Sub scrAzimuth_Exit(ByVal Cancel As MSForms.ReturnBoolean)
txtAzimuth.Value = (scrollsaved + scrAzimuth.Value)
scrollsaved = scrAzimuth.Value
End Sub

Private Sub scrAzimuth_Scroll()
txtAzimuth.Value = (scrollsaved + scrAzimuth.Value)
End Sub


---
Message posted from http://www.ExcelForum.com/