Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help with code?
How do I set up the text box. I currently am using the exit code and when i
leave a box when is empty it comes up with the invalid code message box. I tried the key press code and it comes up with the invalide code in between key presses. What should I use? Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean) Dim ans On Error Resume Next ans = Application.Match(TextBox3.Text, Range("c:c"), 0) If Not IsError(ans) Then TextBox1.Text = Application.Index(Range("a:a"), ans) TextBox2.Text = Application.Index(Range("b:b"), ans) TextBox4.Text = Application.Index(Range("a:a"), ans) TextBox5.Text = Application.Index(Range("b:b"), ans) TextBox6.Text = Application.Index(Range("C:C"), ans) TextBox7.Text = Application.Index(Range("D:D"), ans) TextBox8.Text = Application.Index(Range("E:E"), ans) TextBox9.Text = Application.Index(Range("F:F"), ans) TextBox10.Text = Application.Index(Range("G:G"), ans) TextBox11.Text = Application.Index(Range("H:H"), ans) TextBox12.Text = Application.Index(Range("I:I"), ans) Else MsgBox "NOT IN LIST" End If On Error GoTo 0 End Sub Thanks in advance Greg |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help with code?
Can you be more specific as to what you are trying to do?
Bob "Greg" wrote in message ... How do I set up the text box. I currently am using the exit code and when i leave a box when is empty it comes up with the invalid code message box. I tried the key press code and it comes up with the invalide code in between key presses. What should I use? Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean) Dim ans On Error Resume Next ans = Application.Match(TextBox3.Text, Range("c:c"), 0) If Not IsError(ans) Then TextBox1.Text = Application.Index(Range("a:a"), ans) TextBox2.Text = Application.Index(Range("b:b"), ans) TextBox4.Text = Application.Index(Range("a:a"), ans) TextBox5.Text = Application.Index(Range("b:b"), ans) TextBox6.Text = Application.Index(Range("C:C"), ans) TextBox7.Text = Application.Index(Range("D:D"), ans) TextBox8.Text = Application.Index(Range("E:E"), ans) TextBox9.Text = Application.Index(Range("F:F"), ans) TextBox10.Text = Application.Index(Range("G:G"), ans) TextBox11.Text = Application.Index(Range("H:H"), ans) TextBox12.Text = Application.Index(Range("I:I"), ans) Else MsgBox "NOT IN LIST" End If On Error GoTo 0 End Sub Thanks in advance Greg |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help with code?
If they have to enter something that matches column C in textbox3, why not just
make textbox3 a combobox? Greg wrote: How do I set up the text box. I currently am using the exit code and when i leave a box when is empty it comes up with the invalid code message box. I tried the key press code and it comes up with the invalide code in between key presses. What should I use? Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean) Dim ans On Error Resume Next ans = Application.Match(TextBox3.Text, Range("c:c"), 0) If Not IsError(ans) Then TextBox1.Text = Application.Index(Range("a:a"), ans) TextBox2.Text = Application.Index(Range("b:b"), ans) TextBox4.Text = Application.Index(Range("a:a"), ans) TextBox5.Text = Application.Index(Range("b:b"), ans) TextBox6.Text = Application.Index(Range("C:C"), ans) TextBox7.Text = Application.Index(Range("D:D"), ans) TextBox8.Text = Application.Index(Range("E:E"), ans) TextBox9.Text = Application.Index(Range("F:F"), ans) TextBox10.Text = Application.Index(Range("G:G"), ans) TextBox11.Text = Application.Index(Range("H:H"), ans) TextBox12.Text = Application.Index(Range("I:I"), ans) Else MsgBox "NOT IN LIST" End If On Error GoTo 0 End Sub Thanks in advance Greg -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Code to conditional format all black after date specified in code? | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
stubborn Excel crash when editing code with code, one solution | Excel Programming | |||
VBA code delete code but ask for password and unlock VBA protection | Excel Programming |