I am developing a form to get the user's name. I want to put some default text in the textbox where the user types their name. I want the form to delete the default text when the user clicks on the text box or after they start typing their name.
Attached is the form and code that runs the form : UserName.xlsm
I have a userform with numerous Textboxes and comboboxes for user input - however the end users aren't too PC savvy and I'm ending up capturing "Please Enter NameJohn Smith", "Please Enter Job TitleSales Manager" etc. My original Instructions told them to tab their way through the form, meaning each time they reached a TextBox their input would overwrite the ("Please Enter x") string prompting them for input.
Is there any way to replicate this "select all" on click (globally as there are potentially 50 to 100 textboxes and 12 varients of the form)?
Penfold Auto Merged Post;OK so I've made a little progress:
Private Sub UserForm_Click() TextBox1.SelStart = 0 TextBox1.SelLength = Len(TextBox1.Text) End Sub
The above selects all the text in a textbox - I think I need to apply this to the textbox "on click" - however that could be achieved? Then it needs to be generalised - ie:
I have a userform (FrmComp) and in it i have several Textboxes. When i click on any of the textboxes the calender appears but how i i make the calender assign the date value selected on it to the last clicked on textbox? here's what i have:
I am trying to do is to make it so that users can enter data into my form (I have managed to create the form and am working on trying to figure out how to get the info entered into the form to appear in my worksheet) and then the data will cause the information to, basically, compile sentences that I want to appear in one of three cells at the bottom of the worksheet.
Essentially, at this point in time, the end goal is to make 3 cells that contain text. Eventually, this text will be indexed elsewhere, but that is for the next person to deal with. I am creating a prototype that I want to present as a process improvement.
So, when the user selects 3 in cell D7 I want the text "Customer purchased 3 Widgets at $20 each." to print in cell 82B. I also want the user to be able to copy and paste some customer records from another program directly into a cell in the form that will just print (unchanged) into one of these boxes, too.
Lastly, I want the user to be able to select checkboxes that will, when selected, print a comment that will print in two of these boxes. For example, if the user selects yes for cell D26 then I want the text "Customer not eligible for free shipping" to appear in both cells C82 and D82.
I have a userform with 10 textboxes which will all contain a time in HH:MM format. Could I have the userform to fill the textboxes with a default value once a time has been entered into textbox1. I would like the default value to be the time from the previous textbox plus 30 mins.
eg. So if I enter 14:00 into textbox1 I would like textbox2 to display 14:30, textbox3 to display 15:00.
If this is possible, could I add a Listbox with the options 1 to 10. Then would I be able to only uses the textboxes based on the number selected in the listbox. So if I selected 2 then just Textbox1 and Textbox2 would have values in them. For 8 being selected then Textboxes 1 through to 8 would be filled.
I want to control what a user enters into a single cell based on others.E.g.
A B 1 20 500 2 50 500 3 75 500 4 100 300
Column A is a thickness and column b is a width what I want to happen if the user enters a thickness in cell D1 and a width in cell D2 I want an error to pop up if for instance the user enters 100 as a thickness to only allow a maximum of 300 in the width. likewise if the user enters a thickness less than 100 in cell D1 to allow him to enter up to 500.
I have text in one cell and I need a text box to show the text from that cell.
For example, if I have text in B2, on a text box I put the forumla =B2. The issue I'm experiencing is that the text box cuts off the text. There's no logic to why it cuts off the text, it's not limited to number of characters and I've played about with the margins and wrap texting, etc, all to no avail.
I've attached a photo of the worksheet to show what I'm experiencing. [URL] ..........
I write a daily status report that adds my daily comment to a cell with previous text in it. I then paste it in three other cells. This process is slow and tedious since the text in the cell is now becoming extremely long due to organizational and managerial restraints of the existing format. I use cut and paste and manual enter, a alt + enter, to space new comment. I would like to be able to enter the text in a cell and have it update the comment cell with the text in it and to update the text box. I have reviewed the forum and have yet to find the answer and use of how else to pose the questions.
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.
I wish for a text box (drawn Text Box, from the "Shapes" tab) to conditionally change its background color based on whether a cell in a different sheet says "Online" - in which case it should be green, or "Offline" - in which case it should be red. So far, the code that I have that doesnt work at all, which I'm not even sure where to place (I tried in the Workbook - Open?), is the following:
I also need to do this for a total of 9 Text Boxes, if that changes anything.
In a userform i have created an textbox. The user types some text in it and after clicking an OK-Button this text must be copied to a cell To allow multiple lines (enter = new line in textbox) i have changed the textbox property EnterKeyBehavior to True. The problem is that after copying this textbox1.text to a cell in see square blocks in the cell.
instead of line1 line2
I use the following code to copy the text into a cell:
Private Sub CommandButtonOK_Click() Dim TextboxText As String TextboxText = TextBox1.Text ActiveCell.Value = TextboxText Unload Me End Sub
how to avoid this  (should be like alt-enter in a cell)
Code: Private Sub cmdSearchButton_Click() Dim txtbox As String 'stores lookup value Dim x As Variant 'value for wwid txt box Dim ForeName As String Dim SurName As String Dim wwid As Variant Dim iPosition As Integer
Here is my code, it does a vlookup and if the persons name is not found it will split the text entered into forename and surname but when i try and add
I have a userform containing 3 textboxes, to calculate derivatives.
User enters two integers in textbox1 and textbox2; and to textbox 3, I need to transfer these values but with a little issue.
For example, user entered 3 to textbox1 and 5 to textbox2. In textbox 3, it needs to show 3x^5. For example, user entered 7 to textbox1 and 2 to textbox2. In textbox 3, it needs to show 7x^2.
So "x" and "^" are our defaults in textbox3.I tried to transfer the numbers that the user enters to cells A1 and A2, -I don't know if this works- but I don't know how to call them to change the text in the textbox.
When the Go button in text box in the 'VSVA-1 Data' tab is pressed, a new tab is created. I would like the tab to be renamed after the text that is entered into the text box. Is this possible? Here is what I have so far.
VB: Sub RenameTab() 'Renames the worksheet tab ActiveWorkbook.Sheets("VSVA-1 Data").Select tabName = TextBox1 ActiveWorkbook.Sheets("VSVA Data").Select Selection.Name = tabName End Sub