i have 15 textboxes in my userform (all with tags).
instead of having 15 seperate sub routines that call on one macro is there a way i can write some code that, on entering any texbox within a form, a specific routine would be called
i tried using the Userform_click sub like so, but with no joy:
i would like to create a userform with a textbox to enter a product code , a command button to run VBA and a big text box to show output of VBA from Textbox 1 which i will connect to DB and pull back information relevant to that product code , is this possible i can create the userform no problem and already have code to pull back from DB into Excel ,
I am creating a Userform and one of the elements on it is a combobox where the user has to select their name. On the same Userform, I want to have a textbox (or listbox or another combo box if necessary) which will show the users default cost centre based on the initial combobox selection. I've tried doing this various ways, but I can't get the textbox to update when the combobox selection changes.
I have a userform that has a control button that opens another userform that contains a listbox with a range of data. I want to click on an item and press a control button to add it to a textbox on my first userform. I do this via:
Can someone help me to get the code to copy an existing workbook, with all the forms and code that exist with it, to a new workbook with the data from the cells, and name the file with a new name?
On the attached example i have a user form (click Add New Hedge button) and on this form is a textbox for 'Avg. Price'. The value of entered from this box will go into the next available row in column on 'Unsettled Hedges' worksheet.
My problem is sometimes i would to enter the price as a fraction, e.g. 1/2 and other i would like to enter the price as a decimal, e.g. 1.5. At the moment if i enter the price as a decimal figure this will convert it to a fraction in column D of the 'unsettled hedges' worksheet.
What do i need to change in my code to make it enter the price in either format?
I have a form, and the form has a textbox. I have a button labeled search, and when it is clicked the macro searches for the information in the text box. How do i make the search action begin when the user press'es the enter key while on the textbox?
So I haven't seen this error before. It says "Automation error: the object invoked has disconnected from its clients." I think I know what's causing it but am not sure how to go about solving the problem. Barring any inefficiences that the code below contains, can someone please tell me what code I should used to fix this error?
I am looking for some code that dynamically (during processing) changes the height of a userform. What I am trying to do is this: I have ten worksheets but only five are being used. I am looking to have a userform with a checkbox for each of the active sheets labeled. I don't want to have to display a form that is basically ten checkboxes with five enabled and five disabled. I want to show only the five active sheets checkboxes with a userform only large enough for the five. If six are active then a userform displaying six checkboxes and a userform large enough for only the six to be displayed.
I have text that when you push enter it goes to the next line and when you push tab it goes 5 spaces to the right the problem is...
When i have a lot of data it goes out of range and not all of the text is shown. I want to limit what is written to the size of the text box no matter the size or type the font is you can only type where you can see inside the textbox.
I have a userform with several texboxes formatted as currency. The problem I have is that I cannot enter figures less than £1.00 i.e. (.90) whicch should format as £0.90 Here is the code I am using so far! As I have said it works perfectly apart from this ...
I am trying to enter data using User Forms to apply to a specific cell.
For example the user enters text or a number value into a text box and clicks a command button to submit that information into a specific cell. In this case D43.
I have a very long spreadsheet with about 3000 rows. lets say for simplicity that column A contains a list of product ID numbers. I am looking for some macro code where I can just type in the product ID into a textbox, then hit enter (or a 'go' button) and then the cursor will move to the cell containing the part number.
I know Ctrl+F will do the job for me, but because of the frequency that I do these searches, a text input box would be easier still.
The nearest solution I could find was the one here Find text but its a bit 'overkill' for my needs.
In my userform, I have a textbox where I enter a number.
When I hit the return key in the textbox, I want the userform to act like I hit a commandbutton_Click. (The commandbutton_Click takes the contents of the textbox and locates a line with that number in it in a specific worksheet, and then displays the line of info in other textboxes in the userform).
I have a userform with a textbox in it. Once you type what you want in the textbox, you click on one of two buttons - either Accept or Cancel. It would be much neater if the userform would close when the user hits the carriage return in the textbox. Anyone know how this can be achieved? Kjartan Auto Merged Post Until 24 Hrs Passes;Doh never mind folks, I figured it out...
Private Sub Userform1Textbox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) Userform1.Exit End Sub
I have a userform that has two comboboxes to search data on a sheet and a textbox to input data to a specific cell on the same sheet. The cell that the textbox writes to is determined by the combination of choices selected in the comboboxes. The comboboxes are searching as required but I don't know how to determine which cell to write my data from the textbox to. I'll attempt to clarify...combobox1(drivename) searches the data in column C, combobox2(unconformlist) searches the data in column H. The combination of these determines a specific row and I need to write data from the textbox(initials) into this row in column M.
Private Sub CancelButton_Click() Unload Me Sheets("Index").Select End Sub
Private Sub initials_Change() initials = UCase(initials) End Sub
Private Sub OKButton_Click() Dim ws As Worksheet Set ws = Worksheets("QAQCconformity")...................
I'm trying to enter text (the Assessment Number) into a website text box. the site is Solano County - Online Tax Information the relevant section of website code is
My code is
Sub Solano_View() Dim IE As Object Dim url As String Dim tags As Object Dim tagx As Object Dim parcel As Object
[Code]...
This is creating Run Time error code 438 I've also seen Run time error code 91 while trying other methods
I have also tried getElementById() without sucess
Does this have something to do with tables or java?
Should I be using $("#id") I don't know how to use this though.
Is it possible to change the behaviour of the return button within a textbox? What I would like is, once the return button is pressed, it starts a new line in the textbox rather than it moving to the next textbox within the form.
I want to enter a value in a textbox, search for it in an worksheet, and populate other textboxes with adjacent values if the value is found. Anyway, the problem is that if the value is not found, I get a debug error.
I'm sure there's far better code to do what I need, but I tried to keep it simple. With the above code, it only works if the value is found. If it's not, I get an error. So how do I make it so that if the value is not found, the value of the textbox2 is "Not Found" or something...
I need vba code to retrieve the workbook name and place it into macros. the workbook name does not change in the macro if the name of the workbook changes. so i need to assign the name to a variable then use the variable name as the workbook name............
I have a problem here regarding the combo box. The whole Column A has combobox. It would be easier if by just hitting the TAB or Enter it would go to the next cell just like what is usual in excel.
TAB = next cell to the right Enter = Next cell below
I have a problem to write a VBA code for the following task:
My worksheet has a column that has a unique code in column C (Ex: HR1) which is not repeated throughout column C, and I need to insert the amount of money spent on this specific code.
I would run a userform that has two text boxes, one that I shall enter the unique code and the other text box shall be the amount of money spent. I would like to know of a vba code that can search the unique code of the value entered in the first text box of the userform, then to enter the amount of the second text box into column D in relation to the respective row which the unique code is located.
I would like that the amount entered in column D regarding the unique code could be added automatically by entering any new entries in relation to the unique code selected, if this is possible. If not possible, to go inserting any new date into the next column regarding the same row of the unique code.
i have an excel sheet where i enter company information including Zip code. the zip codes around here all start with 797 and end with numbers from 01 to 12
i am looking for a way to enter just the last 2 numbers and have it automatically insert the full zip
example:
line one i would enter 01 and 79701 would show up in the box.
I know there are ways to do this, just can't remember its been so long since I've had to use excel.
I have a spreadsheet where a date is entered in column A with data in B-F. I am trying to write code to look in column A for a specific date and enter additional data into columns G-L on the same row. It needs to be able to skip the rows that are blank. So I have the dates of 12/1, 12/2 and 12/3 in column A rows 1,2 and 3 and I want to enter data for 12/2 on row 2 skipping the blank cells in row 1 for 12/1. Here is the code I have below.
VB:
Private Sub CBSecure_Click() Dim my_name As String Dim r As Variant Dim l As Long sFind = DockDoorCal.Value If Trim(sFind) = "" Then Exit Sub
I have some VBA code which hides columns based on a cell value. The cell value changes according to which option button is selected. The code works but not when the button is selected and the cell value changes. It is necessary to click elsewhere in the sheet or press Enter to get the columns to hide. I want it to do it automatically as a user wouldn't know to click elsewhere.
The working code is:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Range("N5").Value = 2 Then Columns("O:R").EntireColumn.Hidden = True Else Columns("O:R").EntireColumn.Hidden = False