i am working on a userform that contains several controls one of which is a textbox ,everything is fine except that i need to know which textbox property to use in order to highlight the text writen inside the textbox, i know "setfocus" but thats not excatly what i need, i need to highlight the text inside the textbox.
"textbox.setfocus" sets the focus onto the textbox without highlighting its content
what i need is:
"textbox.ur suggestion" sets the focus onto the textbox & highlight its content, this way i will no longer have to clear the text using the backspace key to write another text
Sub Thanks() With UserForm1 .TextBox1 = "1111111111111" .TextBox2= "BBBBBBBBBBBB" .TextBox3= "Tres" .TextBox4 = "44444444444444" .TextBox5 = "Five" .TextBox5.SetFocus ''''''''''''''''''''''''''''''''''''''''''' .TextBox6 = "666666666" .Show End With End Sub
is there a way to highlight the content of the TextBox5 when Showing the Userform?
I have a spreadsheet and I want to color particular cells in a column with a new color - i.e. any new changes need to be highlighted. I know there's a way to do tracking changes in excel, but it just sticks a little flag almost invisibly in the corner of the cell. I want to be able to bring the spreadsheet back to our administrator and say hey the stuff in red is new.
On a related note - I am working on this massive spreadsheet that is a .csv but I am saving it as an exel spreadsheet - is that ok? I am assuming that if I save it as a csv, it will return to the original formatting just without the colors, filters, etc changes I made - which is fine because I think somehow the .csv file will be uploaded to the system and no further changes need to be made.
I found out the hard way when you have a .csv file and make changes and then save it, you lose all the fun row/column size adjustments, color, etc - but I figure in the meantime I'll work on it as a excel spreadsheet and then return it to it's natural .csv file status.
I want to use a Login screen for a little "request-program" I made. Logging in works and when I log in as an administrator, an extra window pops up where I can add and remove new users (with pass). Users (column A) and passwords (column B) are located in a 'logins'-tab in my worksheet. Adding a new username works fine, but I don't seem to get the password next to the username. When adding a new name, the code searches for a blank cell in column A, adds the name and then sort the rows (so username and password still correspond). Usernames are filled out in a combobox (so you can select one to delete) and passwords in a textbox.
Let's say I place a rectagle/textbox on a worksheet. If I select it and go to the formula bar and write =A1 the content of cell A1 will be displayed in the rectangle (and of course if i change the content of A1 cell, the content of the rectangle/textbox will be updated). How can I do this from a VBA macro? How can I link the content of a rectangle/textbox to a cell?
I am working on a code which works, however, its is not working entirely as i intended. In this example, the body of the email should contain content from textbox.
I have 3 text boxes, not all are expected to be filled out. So if only textbox1 is filled out, the body should only include information derived from textbox1.
Whats happening now is that even if textboxes 2 and 3 arent filled out, the body of email produces blank formulas from textboxes 2 and 3. So how do i fix this code so that if I enter data into textbox1 only, the body of email will not include empty formulas? Ive also attached a copy of the Produced email file. Code in question is in red font
Is there a way to control the vertical size of a textbox, so that we could type in a List of Instructions to our operator, and the textbox would resize depending on the numbers of instructions in the box. Also the items in the cells beneath the textbox would need to move down, to allow for the resized textbox.
I am trying to make a dynamic chart with a drop down/cell selection. I have a table with names vs. months. Each name/month has an associated value. I want to display a bar chart that I select with a drop down. i.e. If I select January, the chart will show january's data. If I select February, february's. Etc.
I tried to set my series values as: =indirect($C$1) where C1 is the entry cell for the month and the value corresponds to a named range. I get an error that says "That function is not valid."
When I try to put just the named range, excel highlights the correct range but then tells me that "the formula you typed contains an error. Try one of the following..."
When I use TextBox.SetFocus in a userform , the curser will be inside the TextBox, My TesxtBox has a value in it, so when i apply the TextBox.SetFocus I want the value to be highlighted insted of only being the active TesxBox.
I have a worksheet whereby many of the rows are hidden. These rows were initialy hidden by means of scipts ( I have numerous scripts to hide data under various criteria) eg: Scripts which hide rows based on cell count, cell color, cell data information etc...
Now that I am able to veiw only the information that i want to see.. is it possible to create a script which selects cells only from rows which are visible? I have created a Named range begining from E:12 to G:500 called "Select_EFG"
Uing the example below, how could I select the cell data from the visible rows (12, 30, 34, 35, 50 etc... up to row 500.) from this Named Range (columns E:12, G:500) .... and paste this information in Sheet 2 Row5 columnC
The following code highlights part of the time (hours or minutes) that will be modified by a spin button. The code works fine (although maybe a more efficient way). Each time you click in the time it will highlight the hours or the minutes, depending on where you click. When you click on the spin button the control loses the focus so becomes un-highlighted. I thought that just setting the focus back to the text box would work but what I am getting now is it highlights on every other click of the spin button.
Private Sub spnTime_Change() Dim dtTime As Date Dim y As Integer If strTimeChange = "" Then MsgBox "Please click on a time to modify it" Exit Sub End If dtTime = Format(ctlText, "hh:mm") y = Me.spnTime.Value...............
Based on if the value in col A contains the characters "TT" I want to select the range starting with this cell and ending at the end at the end of the row I'm using (.End(xlRight) and then merge these cells, change colors etc. And then looping this through a 'range' so that it only occurs where the values occur. I can amend various cells based on this idea, but am unable to identify the range and then merge the cells.
I have the below code that I am using to find an empty textbox with the name FirstName. All it does is place the cursor in the FirstName text box if the textbox is empty, but doesn't really make it stand out. I was hoping to find a way to color the background of the textbox pink, or have it set up so it would stand out somehow.
I have a userform that does search using Name. If there are multiple records found it displays a message "There are X instances of (value in name)" and shows a list box. When user selects Find All, the multicolumn listbox gets populated. Selecting a row in lisbox populates the corresponding values in the userform. Problem is that selecting a row in listbox fails to select the corresponding row in the worksheet. As a result, if i change the values in the textbox (say for eg. Phone) the changes are updated in the row selected on the worksheet but not on the required row! Pardon my innocense, I am very new to VBA. find the attached worksheet. This is not my work, I found it during research. Auto Merged Post;Sorry the previous file had error. find the updated worksheet.
I have a ListBox that comes from the Control ToolBox
I know how how fix
ListBox1.ListIndex = 0
my problem comes because when i run a Macro... I lost the focus of my listbox, I mean once I move around the workbook through vba the listbox does not show anymore... one item of the listbox selected, I mean in blue.
Is there a way to do kind of:
activesheet.ListBox1.Selected(5) = True
I I want to see the fifth item of my Conbo Box on blue, I mean selected
Highlighed the Column and Row of the selected Cell. I have seen someone using it. Whenever he click on any cell the related column and Rows clour change. For Example if I select Cell B5. The Column B and Row 5 change its colur from B1 to B5 and Row from Column A to Column B. If this option is already available in office 2010