I have created several loggers using excel userforms to collect data (in Combo's, Check boxes, Radio Button groups etc). The controls are linked to cells on a hidden worksheet and then a piece of code responds to a "Submit" CommandButton click to send the data off (from the hidden worksheet) to a database. Included in the Submit click event is a call to a Public subroutine which clears the form with lines of code such as "Checkbox1.value = false". This call is also made from a Reset command button click event, should the user wish to clear the form following a mistake. All fairly standard coding. So why doesn't it work on the particular logger I'm now creating? The controls are not being cleared (unless I change the code to clear the Control source cells directly eg worksheets("xyz").range("a1").value=false). Also, when I try to click on a radio button, it requires two distinct clicks to set it (seems like it's one to Set Focus and one to set the control to "true"). Now there are a lot of controls on the form - about 20. I know that an error isn't being generated and forcing it to leave the subroutine early - by placing message boxes after each line of code, which display "Err.number" and the control's value. However putting the msgbox code in does allow the control to be cleared - almost as if, under normal operation, without the box, the link between form and control source cell does not have time to update before moving on to the next line of code. One other thing of note is that if the worksheet is unhidden, the controls are cleared as per usual. Why all this in this workbook and not the others?
The only other observation I can make is that when I created this userform, it had 3 tabbed pages, two of which were copied over from perfectly normal (and working) loggers, along with their code. A third tab was added - the one with the problems. Because of the problems, I deleted the two copied pages and their associated code, removed all reference to multipage1 etc and even removed the Date Time Picker control and replaced that with a text box (because the DTP has given problems in the past). Still it won't work as the other loggers do. At the moment I seem to have two options, either clear the cells instead of the controls, or start from scratch. The former is a cop-out, the second is a PITB and still doesn't explain WHY??? Any offers - to restore my sanity - would be gratefully received.
PS Apologies for War and Peace!
David
Scotland
Is there a way to use lookup formulas on cells that are picked from a Combo box or any other control buttons ?
I would like to have a spin button (or similar) with a range of percentages from 0 - 10 that when selected will add the selected percentage to a value I've placed in various cells.
eg: I've selected 5%. All data enetered in the selected cells will increase in value by 5%, or if I want to change that to 8% all the cell values will automatically change.
I have a form running at all times that is linked to tables that a maintenance form is also linked to. I have to close the form that is supposed to be running all the time, in order enter data in the maintenance form. That should not be. I'm sure this is a real beginner's question, but what setting do I need to change to be able to have both forms running at the same time?
Here is what I would like to do. There are 6 controls on a Form and if any "Pick ME" exists in any of the six controls then display another 6 controls.
Below is the code I have for testing the first control, which works fine. I tried to repeat the whole control again to test for the second control that only works if both = test1 and test2 "Pick ME". Should not happen.
(I also would like to set up a code to prevent Test2 equaling test1 and to prevent test3 from equaling test1 or test2, etc. )
I am looking to do is
If test1 = "Pick Me" or If test2 = "Pick Me" or If test3 = "Pick Me" .....after the last check to see if any match "Pick Me" in Cbotest1 to 6 then set Visible=True (if any match) for CboOptions1 to 6 otherwise set Visible = False for the CboOptions1 to 6.
On Current Event
Code:
If Me.CboTest1.Value = " Pick Me," Then
Me.LabelNewOption.Visible = True
Me.CboOption1.Visible = True
Me.CboOption2.Visible = True
Me.CboOption3.Visible = True
Me.CboOption4.Visible = True
Me.CboOption5.Visible = True
Me.CboOption6.Visible = True
Else
Me.LabelNewOptions.Visible = False
Me.CboOption1.Visible = False
Me.CboOption2.Visible = False
Me.CboOption3.Visible = False
Me.CboOption4.Visible = False
Me.CboOption5.Visible = False
Me.CboOption6.Visible = False
End If
End Sub
I also tried
Code:
If Me.CboTest1.Value = " Pick Me," Then
If Me.CboTest2.Value = " Pick Me," Then
Me.LabelNewOption.Visible = True
' ......same as above (left it out to short post)
Else
Me.LabelNewOptions.Visible = False
' ......same as above (left it out to short post)
End If
End If
Ebd Sub
Can you disable Excel FORM controls (not ActiveX) with VBA?
HI TO ALL,
May any one tell me the procedure for application of form contros in developer tab in excel with example.
Thanks in Advance
I have an excel file that was developed in an earlier version of excel. It has controls(buttons) on it to execute various macros. The buttons work as expected in 2007, but I cannot find a way to add new ones. I tried help, form controls, help controls, and other things in help. No reference to form controls. I want to bring up the form control toolbox, add a button, and then assign a macro to it. Just like I have done in the last 4 versions of excel. So where is the form control stuff?
Thanks
Hi All
I'm trying to put a form control combo boxes and data validation in various cells of a spreadsheet. Unfortunately, users with Macs cab see the combo boxes and data validation cells, they can select the drop down arrows and see the selections, but when they want to click on any of the selections it will not transfer it to the cell. Is there any configuration settings I have to do in the excel program for macs
ANY HELP WOULD BE GREAT!!!
Cheers!
I have a sheet that has drop downs in it. I am grouping rows together under headers. The drop downs do not hide when I click the - button to collapse the group.