Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
userform textbox | Excel Worksheet Functions | |||
Textbox in userform | Excel Programming | |||
Userform ComboBox and TextBox help!!! | Excel Programming | |||
hide a textbox on a userform? | Excel Programming | |||
UserForm TextBox to ActiveSheet TextBox over 256 characters | Excel Programming |