I have a UserForm with several TextBoxes. What I'm trying to accomplish is to move the cursor to TextBox7Quantity if the value in TextBox2 = "FOB". The Code below is in the Change Event of TextBox51. When I run the Userform and key in the data the Cursor moves to the next Textbox in the Tab Order rather than to TextBox7Quantity . Any help would be greatly appreciated.
Posts by tjamestx
-
-
royUK, you're right I do know that. I apologize for the mistake and offer no excuse but to say... My fault and thank you for bringing it to my attention. As always the code you offered works perfectly. Thank you again.
-
First let me say thank you for any help, Novice here. I have a userform with a textbox that is auto populated with a value which is made up from two numbers from two different columns on the worksheet. The first number is the date stored as Microsoft reference (ie today 10/13/2021, 44482), a "-", and sequence number (01). It is stored in column C on the worksheet in the following format, "44482-01". I need to find out if that value exists in column C of the worksheet. Below is my feeble attempt to try and find a match. I get the response "Did not find it" every time the code runs, even when the value does exist in the column.
Code
Display MoreSub Find_Match() Dim TB As String TB = Me.TextBox1.Value If Cells(Range("C2").End(xlUp).Row + 1, 1) = TB Then MsgBox "Found It!" Else MsgBox "Did not find it" End If End Sub
What am I doing wrong?
-
-
Let me re-phase my last question to clarify. If I comment out the "'Me.ComboBox1.DropDown" the list does not reactivate once the selection is made. I'm good with that, what I was pointing out is that before the fix was implemented (commenting out the 'Me.ComboBox1.DropDown) the list would DropDown and show matches with what was being entered by the user, as the user was typing. After the fix you have to use the mouse to click on the list before seeing anything in the DropDownList. If that makes any sense??? At the same time I'm good with that if there is no fix for it. Thank you.
-
royUK, Thank you that does stop the re-activation on the DropDownList. However I noticed the when I type the name of the customer the DropDownList does not show matches of what is typed. Is there anyway to correct that? If not its not a big deal the user can type a few letters and then click on the arrow and get the same result. Also, Thank you for the correction on the SaveAs, I will make those changes. I really do appreciate the help on this. tjamestx
-
-
I have a searchable ComboBox (original VBA came from https://trumpexcel.com/excel-d…-with-search-suggestions/) for the customer name. The problem I'm having is, after the ComboBox is filled. The ComboBox continues to reactivate anytime change is made to any other cell on the worksheet and also seems to stay active when the workbook is closed.
I have attached a copy of the worksheet and unprotected it so everything is visible.
Any help on this would be greatly appreciated.
-
Alan, thank you for informing me of the mistake in posting and for correcting it for me.
sktneer, thank you for fixing my issue with the VBA, its works exactly as I wanted.
tjamestx
-
I have a template workbook that has a drop down list for the user to choose a Customer Name. I then have a function [=IFERROR(VLOOKUP(J13,Customer Data!A2:C202,3,FALSE),"")] looks at cell J13 and returns the Customers Street Address on an exact match. I have the validation error turned off so the user can type in a name that may not be in the drop down list.
My questions is because the function will wipes itself out if the user enters a name not in the list. I'd like to be able to re-insert the function when the template is closed so the next time it opens the function is there.
The Private Sub Workbook_BeforeClose(Cancel As Boolean) looks like this:
Code
Display MorePrivate Sub Workbook_BeforeClose(Cancel As Boolean) If Date = Range("O4").Value Then Range("O4").Copy Range("P4") End If Range("B41:L43").ClearContents Range("C33:C35").ClearContents Range("B22:M28").ClearContents Range("J12:M15").ClearContents Range("J14").Select Range("J14").Formula = "=IFERROR(VLOOKUP(J13,Sheet2!A2:C202,3,FALSE),"")" Range("C9:D9").ClearContents Range("A1").Activate Range("C9").Activate Application.DisplayAlerts = False With Application .WindowState = xlMaximized End With Range("O7").Value = "run" ActiveWorkbook.SaveAs ("\\server1\share\QuickBooks Common\Templates\BOL_New.xltm"), FileFormat:=53 End Sub
I hope I've posted this correctly, so if not I apologize in advance.tjamestx
-
Stops running after "Sheets("CUTTING").Select". Any help would be appreciated.
Code
Display MorePrivate Sub Sav_Click() Dim Path As String Dim FileName As String Path = "C:\Users\TOM\Documents\Company Files\RSC\Orders\" FileName = Range("C3") ActiveWorkbook.SaveAs FileName:=Path & FileName & ".xlsx", FileFormat:=51 Sheets("VO").Select Range("B19:D27").Select Selection.ClearContents Range("B13:D13").Select Selection.ClearContents Range("C9").Select Selection.ClearContents Range("C7").Select Selection.ClearContents Range("C5").Select Selection.ClearContents Sheets("CUTTING").Select Range("A1:A5").Select Selection.ClearContents End Sub