Remove Part Name/Caption From UserForm Controls
Jan 17, 2008
UserForm1
Current OptionButton names are like ABC123, ABC 124, etc.
How can i change all names, with code - as i am not seeing a find and replace option within UserForms, to all but the "ABC" part, the result of the OptionButton names shall therefor be 123, 124, etc. - delete "ABC" or, find "ABC" and replace with
View 4 Replies
ADVERTISEMENT
Nov 23, 2007
I have a label control whose caption is set from text from a work sheet
How can I set the text of the caption to bold
View 9 Replies
View Related
Feb 12, 2014
Is there any way to remove the first part of a string of text in a cell and save the second part?
The first part of the text string is a team code that has a variable number of numbers, capital letters and sometimes spaces. The second part of the text string is a variable number of words in a team name that all start with a capital letter and have lower case letters. Every line has a different team code and team name.
The original spreadsheet also has a column with just team code. Is there a way of using this column to "subtract" the team code from the text string to just leave the team name?
View 5 Replies
View Related
Jun 17, 2014
I am using a userfrom in my sheet. i want to link label2 = sheets("OF $").Range("D6").value
I mean I want to lable2 = cell value as link
View 3 Replies
View Related
Feb 2, 2008
Background: I currently have an some VBA code that will kick off a series of calculations on a remote server (7 calcs). I am showing a modeless form, to allow the user to continue to work in Excel while the external calculation is taking place. The code checks every few seconds (using .OnTime) to check the status of the calcs, and as one finishes, it starts the next calc, and updates the form (ie - "Running Calc #3 of 7", etc).
'Do calc
'Finish calc
frmProgress.labMessage.Caption = "Running Calculation: 'Revenue'"
'Do another calc
'Finish another calc
frmProgress.labMessage.Caption = "Running Calculation: 'Labor'"
'etc...
Problem: when I change the label on the form, it gives the form focus. So, if the user is in the middle of doing something, they are suddenly stopped, and have to click back on the spreadsheet to continue.
Questions: Is there a way to update content (label) on a form, without that form getting focus? If not, is there another way to provide updated feedback without disrupting what the user is doing? My fallback is to simply not update the form with progress reports, but since the calcs can take 5min or so, it would be good if they knew things were progressing.
View 3 Replies
View Related
Jun 20, 2008
I present a form (a calendar) twice in my routine to the user but I want to change the Caption of the Label on each pass?
e.g.
The first time it's displayed: 'Please select a start date' (calendar closes & goes off and does stuff)
... and on the 2nd display: 'Please select an end date'.
View 7 Replies
View Related
Mar 31, 2014
Is it possible to load an image into a label and have the caption for the label be visible too? I've only been successful having one or the other display but not both.
View 2 Replies
View Related
Mar 29, 2008
I have frame on a userform with command buttons. Is it possible to loop thru and capture the command button captions in a textbox. I'm trying to put together keyboard on a userform, so the user can populate a textbox with letters or phrases.
View 6 Replies
View Related
Apr 20, 2008
I want a floating userform (showmodel = false) to display the results of a cell.
On excell spreadsheet I can assign a cell value to an object/shape, as the cell value changes so does the display on the object automatically.
I want the same results on a userform.
As i want this for display purpose only can i use the label caption for the above question?
View 3 Replies
View Related
Feb 4, 2014
I have a userform which has a number of multipage controls nested inside each. So, the parent is Multipage1 with 2 pages. Page 1 of Multipage1 has a second multipage control (Multipage2 which has 4 pages). In Multipage2, page1 there is a 3rd Multipage control (Multipage3 which has 2 pages). In Multipage2, page 2 there is another multipage control (Multipage4 which has 3 pages)...and so on! I know this sounds complicated, but I am trying to get the caption of the selected multipage.
There are commandbuttons in all of the pages, which when clicked need to return the caption name of the multipage where they sit.
I have started the following code, but suspect there must be a better solution:
VB:
With Sales
If .MultiPage1.Value = 0 Then
Hardware_Purchases_Input.TextBox6.Value = .MultiPage1.SelectedItem.Caption & " - " & .MultiPage2.SelectedItem.Caption & " - " & .MultiPage3.SelectedItem.Caption
End If
End With
View 3 Replies
View Related
Jul 16, 2014
How to copy a label caption (from userform) then paste it in a worksheet.
View 2 Replies
View Related
Aug 9, 2009
I have multiple Userforms with labels etc, all controls are similarily named (so I could do this) and I can refer to the Userform dynamically but the Label caption/Controls don't change, any idea's how to get them working.
View 7 Replies
View Related
Feb 29, 2008
i've got a form that shows employee data in labels, and i'd like the user to be able to double click a label to change it (using a pop-up form). is it possible to get the pop-up to show after a double click instead of a single click?
View 5 Replies
View Related
Jul 2, 2007
I am trying to change the property value of all optionbuttons on userform1 via userform2's deactivate event
Private Sub UserForm2_Deactivate()
If userform1.Controls = OptionButton Then
Value = False
End If
End Sub
View 5 Replies
View Related
Oct 29, 2009
I have a list of data that populates B2:B2900
This data is often prefixed by a 'reference code' that I wish to be removed.
Now rater than perform this manually aprox 3000 times is there a formula or some VB code that will complete this for me....
eg
The list of data is shown like:
SC7547-05 - Payne, Freda
SC8706-08 - Rungren, Todd
SC8714-05 - Travis, Randy
SC7517-03 - Beach Boys, The
Love Song
Now You're Gone
SC7512-01 - Horton, Johnny
SC8721-15 - Journey
So I wish for the SC7547-05 - to be removed from the first example to just leave Payne, Freda and continue this throughout the list
However if the data is found not to include this code (as in the 5th/6th examples above) leave it alone
So if the code of formula is run for the above the outcome would be....
Payne, Freda
Rungren, Todd
Travis, Randy
Beach Boys, The
Love Song
Now You're Gone
Horton, Johnny
Journey
View 9 Replies
View Related
Aug 15, 2012
I have a userform that has nested multipages (5 in the outer page, 4 in the inner page).
On each of these multipages, I want to have the same controls (sliders) laid out in the same order - but with unique names, named after their tab location, for each control so I can use their value property later in the code.
I've designed the layout and named all the controls on my first sheet (e.g. Slider1Outer1Inner1). I now need a way of automating the replication of these across the other 19 sheets (including the nested inner multipage!); so that equivalent slider for example would be called Slider1Outer1Inner2, Slider1Outer1Inner3 etc.
I'm not sure about coding VBA to act on items within VBA...
VB:
" For each multipage in outer
For Each multipage In inner
For Each Object In current multipage
Copy inner.object -> Next multipage
Inner.object.name = CurrentOuter & CurrentInner & CurrentSlider "
View 2 Replies
View Related
Nov 17, 2008
What's the best way to hide controls on a userform? I have a userfrom with 2 datepicker one for start date and one for end date. I want them hidden until I use checkbox and check it to appear. I am using this code but nothing is work.
View 2 Replies
View Related
Jan 23, 2009
I have taken this code from Access and trying to use it in Excel to lock all the TextBox, ComboBox & CheckBox on the form.
View 2 Replies
View Related
Jul 18, 2012
How to disable different parts of a userform?
I dont really want to go through each control as I reckon it will be handy code to have in the future if I need to add more but so far my code is:
Private Sub UserForm_Activate()
With Sheet2
n = 3
[Code].....
View 2 Replies
View Related
Jul 11, 2008
I have a number of TextBoxes across the page, all set to Visible=False.
If these get filled with data then I need to set Visible=True.
Rather than hard code this individually for each one (which is not a problem, it just looks untidy), can I select each row as a Group (whilst designing the form, not in the code) and then set that Group to Visible=True ?
View 9 Replies
View Related
Nov 4, 2009
I have a userform that contains several textboxes, checkboxes, and comboboxes. There are also some command buttons, one of which says clear all. What I want to do is loop through the controls and clear the contents or change the value to false, depending on the type. I can do this by type the name.value = "", but there are alot of controls. If possible, a loop would be much more effecient.
View 9 Replies
View Related
May 18, 2006
I am trying to create some controls in a userform on the fly based on the data in a sheet. The part of my code is the following:
summaryForm.Controls.Add bstrProgID:="forms.label.1", Name:="LAWts", Visible:=True
With summaryForm.Controls("LAWts")
.Top = 120
.Left = 20
.Height = 18
.Width = 300
.Caption = "Weights: "
End With
Question I is that how can I connet this textbox to a click event or just to a procedure when it is clicked? I tried to use OnAction but it does not work for textbox in a userform. Question II is that how can I find the all properties of a textbox or any other controls? Is there a manuel or reference available on the internet?
View 3 Replies
View Related
Aug 4, 2006
What are the pros/cons of using Userforms with the various objects (comboboxes, textboxes,etc) compared to putting the controls at the worksheet level? Are there things you can do in one and not the other?
View 2 Replies
View Related
Oct 25, 2006
I am trying to transfer data from a worksheet to a user form, so that the end users can edit the data on the user form, save it, and the revised data is sent back to the worksheet. since the worksheet data is dynamic, i am trying to dynamically add controls in the user form. but the form displays only one data.
Set sdel = Sheets("Deliverables")
Set rStartCell = sdel.Range("A65536").End(xlUp).Offset(0, 0)
counter = Mid(rStartCell.Address, 4)
dummy = 0
cnt = 1
'copy data from sheet to the user form
With sdel
'checking if deliverables sheet has any data
' If .Range("A3") <> " " Then Exit Sub
' MyTextBox.Caption = .Range("A3").Value
For r = 3 To counter
If .Cells(r, 1) <> "" Then
Set MyTextBox = Controls.Add("Forms.Label.1", "lbl" & cnt, Visible)
MyTextBox.Top = topadd + 30
MyTextBox.Left = 20
MyTextBox.Width = 150
MyTextBox = .Range("A" & r).Value
cnt = cnt + 1
Else
dummy = dummy + 1
End If
Next r
End With
View 3 Replies
View Related
Feb 24, 2007
I have a userform with a series of textboxes used for data entry (numeric values) specifically, 3 groups with 5 text boxes per group. If the value of any text box within a group is either >= the value of a cell in a worksheet range (Benchmark, i.e. BM), then the BackColor of that particular text box changes to green.
The challenge I have is trying to loop through each set of five controls to determine if the control's value is >= to the cell's value in the worksheet range, and if that condition is met, than changing the BackColor to green.
I know there must be a more efficient way to make this happen than to write an 'If - Then' for each text box (see code below)
Private Sub Benchmarks()
BM1 = Worksheets("Sheet 1").Range("A1").Value
BM2 = Worksheets("Sheet 1").Range("A2").Value
If txtGroup1Box1.Value <> "X" And txtGroup1Box1.Value <> "" And txtGroup1Box1.Value <= BM1 Then
txtGroup1Box1.BackColor = &HFF00&
Else
txtGroup1Box1.BackColor = &H80000005 ............................
View 9 Replies
View Related
May 9, 2007
i build a userform that includes 6 columns, and use named range to to be shown in the userform.
i use simple code to call this userform.
excuting the code, the userform appears ok.
i saved my file as an addin to be able to call my userform
the problem that the userform appears empty, no data and no columns, when calling the userform from the addin file whearas the userform works fine with the named range when calling from an xls file.
any idea how to solve the problem ?
pls find the attached file
File deleted as it of no help.
View 9 Replies
View Related
Dec 14, 2007
way to allow a user to add a control to a userform without going into the VBE. Here is the situation, I am developing a userform to calculate a projected budget. I want the user to be able to select the number of controls to add, and click a command button to add them. Based on other selections that the user makes, different controls would automatically be added. Is this possible? As a follow up, will I be able to atttach code to these new controls?
View 9 Replies
View Related
Mar 4, 2008
On the event that a combobox is changed the objects on my userform that relate to the same information as the combobox need to be disabled (and made invisible)... however if another choice is made then they need to be enabled again and then the objects relating to the new selection need to be disabled.
Private Sub cbo1_Change()
Dim DisableIndex As Integer
Dim CellAddress As String
Worksheets("Matrix").activate
ActiveSheet. Range("B1").Select
Do
If ActiveCell.Value <> cboVarNamEn.Value Then
ActiveCell.Offset(0, 1).Select
End If
Loop While ActiveCell.Value <> cboVarNamEn.Value
CellAddress = ActiveCell.Address(ReferenceStyle:=xlA1)
ActiveSheet.Range("B1:" & CellAddress).Select
DisableIndex = Selection.Cells.Count
Me.FrameAddEn.Controls("label" & DisableIndex).Enabled = False
Me.FrameAddEn.Controls("label" & DisableIndex).Visible = False
'there a few other objects here that will also be disabled... text boxes, check boxes etc.
Putting an unload/load command in won't work for obvious reasons and I can't use a command button because that would require my clients to actually think of pressing it.
View 3 Replies
View Related
Nov 27, 2005
building a worksheet to list people, payrates and hours worked etc. the header needs to have fill in areas that change with the job so I entered them in the rows rather than in a proper header. what I want to do is get rid of gridlines in the first 6 rows but
leave them intact on the rest of the document. I see templates that this was done somehow.
View 11 Replies
View Related
Jun 16, 2009
I need to remove duplicate Part Numbers where other information in the cells will not match. In the following two examples, the only difference is that the COMP_ID: number is different, but for my purposes, the second example is a duplicate and needs to be removed. I have hundreds of rows of this type of information with various part numbers: ...
View 9 Replies
View Related