View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
radarguy radarguy is offline
external usenet poster
 
Posts: 1
Default Limits on Userform textbox

Hi Guys,
I am somewhat new to advanced VBA but trying real hard. One concep
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 an
display the change in a "textbox" that I can also just type in
number. The code I have come up with from Excel help is below. I
works ok until I try to edit the textbox with a number greater than th
limit of the scrollbar. Can anyone help me? Also, If anyone can giv
me a simplified explanation of what exactly the three scrollba
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 Su

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