I have a form and I would like certain textboxes to be inaccessible via tabbing. In the properties for each textbox I have selected LOCKED, so that their values cannot be altered. Is there a way to completely bypass them when tabbing?
I am trying to create a excel based form (not User Form) which meets some our business accessibility standards (i.e. a user who cannot use a mouse, must be able to complete it using the keyboard).
I have got around the checkbox issue by creating faux checkboxes and asking the users to enter an X if appropriate. However, part of the information that they need to complete is in the form of a drop-down list (the information is being collected by a hidden datasheet for importing into Access and we need to control the format of the information being provided). I originally implemented this by using data validation on a cell and linking to a named range on a hidden sheet (there are over 100 options to select from). This made it easy for the user to tab to the cell with the data validation in it but, because of the length of the options list, it was a bit unwieldy and users were a bit frustrated by not being able to enter the first couple of letters and for the entry to auto-complete (maybe this is possible in a data validation created list but I couldn't seem to implement it). I have now created a combobox in place of the cell (from the Control Toolbox) and linked this to the name range - so far so good and I have autocomplete working. The trouble now is that I can't get the combobox to get focus without using the mouse to click it.
After writing "War and Peace", what I wanted to know is if I can do this by VBA? The trouble is that I am a good magpie and can kind of cut and paste code if I can find it but I am shocking when it comes to writing anything from scratch. My instinct tells me that I want to trigger some kind of code when the user tabs out of the cell before the combobox to activate and dropdown the combobox and then to be able to either tab or hit enter in order to give focus to the next cell in the form.
The sheet and workbook are protected with only the cells requiring completion being unlocked.
I may be doing this wrong, but I have a form that i created using Active X controls in Excel 2007 (I couldn't use the form control text box, it was greyed out). I have textbox1, textbox2 etc... I got the form to work but I can't tab through. When the user is done entering data in textbox1, I want to set the focus to textbox2. i would like this to happen with enter and tab.
I created a user form to get information to be added to a spreadsheet, and then later needed to add a few more fields. Now when you tab through the fields, they are out of order. For isntance it will tab down through the first three fields, then flips to the second column of fields, then back to the first again.
Is there a way to setup the order in which fields are tabbed? (Note: I am refering to the tab key on the keyboard being used to move between fields, not tabbing a form to create multiple pages.). How do I add a horizontal rule to the form? I dont see it in the toolbox...
I have a Userform containing Textboxes and ComboBoxes. On all of the textboxes the TabKeyBehavior property is set to False.
Sometimes when you are typing either a textbox or a Combobox when you hit the Tab key to tab to the next field it tabs you over 5 spaces instead of going to the next field.
Anybody run accross this and find a solution to it. I have only run into this with excel userforms and never in Access db forms.
i have 2 userforms one with textboxes and the other one with listbox and textboxes.
Everytime user input their data(ie:first name, last name, address etc) in the first form the data's going to be saved in Worksheet("customerSheet") and later on to be displayed in the second form. using the listbox you can select the customer's name and the customer info will be displayed in the textboxes.
My cell to cell tab function is not working properly in Excel (but works in other programs like Word). Instead of moving one cell to the right, such as A1 to B1, when I hit the TAB key it moves from A1 to T1, then to AM1. This is the case in EVERY excel document I open/create on my work computer (but all other computers at work do not have this problem). The documents are NOT protected and the cells are NOT locked.
I have a big clunky spreadsheet that I thought I'd tidy up by adding a userform to keep the info
There's a combination of textboxes, option buttons, listboxes and a multipage. Everything seems to load correctly, and selecting an item in a listbox correctly fills the textboxes, but when I change the value of the textboxes, only 2 out of 4 holds that value and sends it to the correct cell.
The code that is supposed to send all the values is;
VB: Private Sub CommandButton1_Click() 'check that a row has been selected If Range("K3") = "" Then
[Code].....
The culprits are TextBox3 and TextBox4.
I've tried changing the names, I've checked that there are no other textboxes pasted on top, I've even tried adding in a MsgBox line to show the value of the textbox; if the form loads and the box grabs a value of "ABC" from the spreadsheet, and I change it to "DEF", when I hit the button to execute the above code the textbox goes straight back to "ABC".
But it's not an issue with TextBox2 ...
Other parts of the code include a UserForm_Activate block and 5 x ListBox_Click's.
So the think is that i have 197 textbox and i whant it to fill them with the range of a sheet preselected automatly with a loop.Whitout a loop i have this.
VB: Dim e As Integere = CInt(TextBox198.Text) TextBox1.Text = Sheets("Dia" + " " + CStr(e)).Range("A3").Value
that work, but its to slow, if i try this and also to modify
VB: Dim e As Integer For e = CInt(TextBox198.Text) To CInt(TextBox199.Text) Dim i As Integer For i = 1 To 17 [code]....
Where Textbox198.text define the start day (sheet), and Textbox199 the final day, this is highlighted.Also i dont know how to write the textbox(i).text loop, i try a lot of ways and always have problems.I tried to write like this that also didnt work out: TextBox & i & .text and TextBox+i.text
how to create an array of textboxes in excel vba. I have declared an array of type textboxes and I'm still getting errors. I'm assuming its a flaw in my understanding here. The error is Runtime error 13 'type mismatch'.
I'm populating the textbox (which is locked, so can't be edited) using
Private Sub ComboBox1_Change() If ComboBox1.Value = "JS Logs" Then UserForm1.TextBox1.Value = "A load of info on how JS works" & vbCrLf & "blah, blah blah" elseif etc. etc.
Does anyone know how I can add formatting to the textbox? E.g. making certain bits of the text Bold/italic/different size/underlined etc? I don't want to apply this format to the whole textbox, just bits of the contents (i.e. sub-titles)
I have a user form that has a section of 32 text boxes that all information randomly placed inside some of them. Most of the them will be empty.
Is there an easy way to have have a macro loop through these text boxes and find their values (if they have any), and then place those values on the next available row in a worksheet?
Here is a picture of what they look like
What I'm trying to do is get the next rows in my sheet to say: 5 1 22 32 11 23 1 15 etc...
I have about 21 textboxes that are going to be watched by 1 textbox called totaltime on a userform. I created the code below to add up those 21 textboxes, but it's not showing anything even though they are populated, some with zeros and some with one through eight.....
I have a number of textboxes, or other boxes, using exactly the same code. In visual basic you can assign an index to these boxes and create one code where the index number specifies the box you are working with.
I have tried finding a way to do thing in VBA, but came up against a blank. I realise that this is either not possible or very simple, but right now I am stuck with the 'not possible'. Does anyone know if the 'very simple' is an option. It would greatly decrease the size of my program, make it easier to visualise and not make me change to much each time. Of course I refer to subs as much as possible making these routines 3 line routines (sub-call-endsub), but still there are a lot of textbox1_click() routines whereas textbox_click(index) would be nicer.
I am working on a form in VB and have a textbox that needs to be formatted so that every four spaces in the TB has a dash (users will input an Account Number).
UserForm1, page5. From Combobox1 I choose a city and the textboxes give me the values from Sheet3. I'd like to color in green the smallest value. for example, if for LHR I find for A-4214, B-4420, C-3127 => value 3127 to be green. The problem is I have more textboxes in other pages and some of them are colored in green also. Is possible to reffer to these textboxes from page5 only?
I have a userform with 3 textboxes. The user will put numbers into 2 of them and the 3rd will add the other 2 textboxes together. My problem is that the result is just stringing the values together and not adding them together. So if textbox1 is 2 and textbox2 is 4 the result is 24 and not 6. Can someone tell me where im going wrong?
Can I use a commandButton too clear data out of my textBoxes. Been reading a lot and do not understand how,I'm the type of guy if you show me too the water I will drink it. I will send a example of what I want too do.
I've got a workbook (attached) with a UserForm that summarizes transactions entered in columns A and B based on the entry (color) in column A. If you click on the Button (Summary (Show/Hide)) it brings up the UserForm.
A couple of issues I've struggled with: 1. I'd like the UserForm to open when the workbook opens. 2. I'd like the UserForm to update as entries are made in Columns A and B when the user tabs out of column B 3. I'd like the UserForm to always stay open; the user cannot close it.
I've got the same data in cells G26:M34 but these cells don't "float" as the page moves down. This is the reason I've gone to a UserForm to accumulate the data.
I have a userform with a number of textboxes where the time is entered in the format like 00:00, (24 hour clock).
What I need is code to calculate the time in minutes / hours between 2 of these textboxes and for the result to be displayed automatically in the third textbox with no user input required, (other than to put in the start and end times).
The third textbox must display the result in the same format as above - here is the code I use to get the textbox to force the time in as above;
Code: Private Sub TextBox3_Change() Dim t As Date 'If they enter 4 digits and NO colon e.g. 1400 If Len(TextBox3.Value) = 4 Then
Private Sub TextBox135_Change() On Error Resume Next TextBox138.Value = Format(CDbl(TextBox135.Value) / CDbl(TextBox86.Value), "0.0000")[code].....
It suppose to take one input and calculate for the other variables the problem is that once it writes the outputs the other text box it activates the second text box code so I keep getting the error "13" and the result is the same no matter what number I put.
I have a combobox in which are the numbers 1 thru 10. I'd like for the user to be able to choose a number and then that number of textboxes appear below. I have the textboxes invisible on the userform and I'm trying to work out to code to show them when the number is selected (by command button). Heres my code, it only seems to show my first set of textboxes no matter what number is in the combo box. Can someone please help me make this work? And is there a more concise way to do this?
i changed the names of the textboxes because i built the form before i thought about the code and frankly there are too many all together for me to remember their names
Private Sub CommandButton7_Click() 'Ok button page 3 Dim i As Integer Dim j As Integer
For i = 1 To 10 Select Case Val(ComboBox21.Text) = i Case 1
I was just wondering if there is a more efficient method. I have a UserForm that requies textboxes to be filled. I have a commandbutton1 on the form called "next" which is only enabled after all the fields have been filled. If any field is blank, I want the commandbutton "next" to be disabled. I have many UserForms so I wanted to see if there is another way than my own primitive method - I have a code for the change event of each textbox
Private Sub TextBox1_Change() If Me.TextBox1 = "" Or Me.TextBox2 = "" Then Me.CommandButton1.Enabled = False Else Me.CommandButton1.Enabled = True End If End Sub
Private Sub TextBox2_Change() If Me.TextBox2 = "" Or Me.TextBox1 = "" Then Me.CommandButton1.Enabled = False Else Me.CommandButton1.Enabled = True End If End Sub
Private Sub UserForm_activate() Me.CommandButton1.Enabled = False End Sub
Say I have a userform that has a bunch textboxes on it. If I wanted to take 20 of those textboxes, and scan through and count which ones have values, is there a simple way to do that?
I need to make it so that if more than 11 of those 20 textboxes contain text, a msgbox will popup and tell my users they are exceeding their limit.
I was thinking one way may be make them all a list, and then somehow count through the list and once the count reaches a specified number it msgbox them...but I'm not sure exactly what the process is for that.
If I copy several cells and try to paste into my userform textboxes they all end up in the first textbox. There are of course equal amount of textboxes as copied cells. How can I make each following cell to be pasted in their seperate texbox?
e.g I copy range A1:A4 and try to copy into 4 textboxes by starting with the first textbox.
I am working on creating a userform to make sure that information gets entered correctly into a spreadsheet. This is a rather large user form with numerous text and list boxes on a number of tabs. I also have a toggle box at the top of the form that helps choose what sort of data I will be needing. When the toggle box is selected I only need about half as much information and do not want users to be able to enter the rest. I am looking to enter code that changes the enabled property of the unneeded boxes to false when the toggle button is selected and back to true when it is clicked off. Unfortunately, this involves about 50 text/list boxes. Things are going to get very messy if I need to write out a seperate line for each of these items.
My question is this. I know there is a way to group these boxes and change the properties of the group as a whole in the editor, but is there a way to refer to such groups and their properties in my code.