Assessment Questionnaire With Controls & VBA

Nov 23, 2009

I am designing a skill assessment questionnaire and want to use radiobuttons to keep it user friendly. I have about 100 line items with 6 radiobuttons and 1 checkbox. I want to assign a linked cell to each button and group the radiobuttons of each row (plus set a default value.) As the number of buttons is large I am looking for a way to do this efficiently without manually changing the GroupName in the properties window. Currently, I create the buttons automatically but cannot change the desired attributes (groupname and linkedCell) unless I explicitly address the respective button by its name directly.

ActiveSheet. OLEObjects("OptionButton2").Object.GroupName = MyRange
ActiveSheet.OLEObjects("OptionButton2").LinkedCell = LinkOB6

This it not practical though due to the large number of buttons in the spreadsheet.
Currently I try to address the buttons with other variables but this does not work. my current code is the following (for only 5 rows and 2 buttons per row):

Sub Buildbuttons()
Dim RowNo As Integer
Dim i As Integer
Dim x, y As Integer
Dim xdif As Integer
Dim ydif As Integer
Dim LinkOB1, LinkOB2, LinkOB3, LinkOB4, LinkOB5, LinkOB6, LinkCB1 As String
Dim OB1, OB2, OB3, OB4, OB5, OB6, CB1 As String
Dim MyRange As String
' now of rows to fill
RowNo = 5
'define starting position and distances
x = 20
y = 5
xdif = 54
ydif = 18
i = 1.................

View 4 Replies


ADVERTISEMENT

How To Enter Text (Assessment Number) Into Website Textbox

Aug 21, 2013

I'm trying to enter text (the Assessment Number) into a website text box. the site is Solano County - Online Tax Information the relevant section of website code is

My code is

Sub Solano_View()
Dim IE As Object
Dim url As String
Dim tags As Object
Dim tagx As Object
Dim parcel As Object

[Code]...

This is creating Run Time error code 438 I've also seen Run time error code 91 while trying other methods

I have also tried getElementById() without sucess

Does this have something to do with tables or java?

Should I be using $("#id") I don't know how to use this though.

View 9 Replies View Related

Locking Columns On A Questionnaire Spreadsheet

Sep 16, 2009

I am trying to develop a questionnaire spreadsheet using a ranking system. I have different questions (based on certain criterias) and four columns for each question: NEVER | SOMETIMES | MOST OF THE TIME | ALWAYS.

I want to see if there is a way that I can lock the other three cells when the user has chosen a particular column by typing an X. BY doing so, I want to ensure that the user will not choose two options (or columns) instead of only one, because if he/she does it will mess the other calculations that are not shown within the table. Only the input and output are shown.

View 8 Replies View Related

Multiple Questionnaire Check Boxes Limited To X Responses

Jun 1, 2008

As part of an audit program I have a questionnaire. One of the questions has 10 check boxes, one with a combo box and one with a text box. The user will check at least 2 or more answers, but not all 10. (2-4 average). I don’t want to link the answers to specific cells, because I don’t want the answers to display with blank rows between answer on the sheet. I want the answers to display in 2 columns evenly distributed.

I would prefer, to not have to run a macro, if possible, but the only way I could see to do this is a very long if statement base on every combination of answers. If the only way to do this is thru a macro, I would prefer to tie it to the printing of the sheet, or I could make it part of an error checking macro I plan to do. The actual question is in the attached file

View 7 Replies View Related

VBA Macro Event For Questionnaire With "X" & Yes/No

Dec 4, 2008

I have created a worksheet to track/calculate compliance with a number of important items at a number of business locations on a number of questions. This workbook will be posted on a central server that will allow 25+ employees to access it from the field and "double-click" to enter an X in either a "Yes" or "No" column for about 100+ locations (the code also will remove the "X" in either column if another "X" is entered into the other column to prevent double entries). The workbook will be quite elaborate and will be locked down except for those cells unprotected for data entry (identifying location, date, etc.).

Below is the code and it works just fine as written with two columns to chose from to "double-click" and enter an "X" (columns C & D for rows 4 thru 15). I want to "freeze frames" locking columns A & B and allow scrolling to the right to enter each New Location and allow the same code to apply to the same rows but column groupings of E & F, G & H, I & J, ...until I have about 100+ sets of two columns identified in the code.

I have tried a variety of changes to the "Union(Range" and "Intersect(Target, Range" last night and this morning to no avail and have gotten nothing but a headache and a desire to drink heavily from the exercise.

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Range, Cancel As Boolean)
Dim rInt As Range
Dim rCell As Range

Set rInt = Intersect(Target, Range("C4:D15"))
If Not rInt Is Nothing Then
For Each rCell In rInt
rCell.Value = "X"
Next
End If
Set rInt = Nothing
Set rCell = Nothing
Cancel = True

View 7 Replies View Related

Tab Between Controls

Jan 4, 2007

I created a form using multiple text boxes and combo-boxes using Excel VBA controls but do not know how to enable the ability to tab between those boxes. "Auto Tab" doesn't seem to do it.

View 9 Replies View Related

Extra Controls

Mar 26, 2009

i've been scrolling through the Uerforms extra controls and just wondered if there is a comperhinsive list of them and what they actually do?

View 2 Replies View Related

Subtotal Controls

Dec 13, 2007

I have added subtotals to a worksheet, as I have many times before, but this time I don't see any controls off to the left. I am at a loss as to why this might be happening or how to get them to display. Have I toggled something off or on that might be causing this?

View 4 Replies View Related

Controls(num) What Parenthesis Mean

Jan 6, 2007

In line me.controls(0) what (0) stands for?

I thought it's for tabindex but after experiment it's not.

View 9 Replies View Related

Multipage Controls

May 15, 2006

Can you run a procedure when a particular page in a multipgae control is clicked rather than use the Multipage change control.

View 5 Replies View Related

Active X Controls

Nov 14, 2006

My excel macro's run fine under Windows 2000 Pro, and Office 2000. The company got a new computer with Windows XP. I now have macros that run OK however I keep getting a pop up message stating. Warning..An active X component is being loaded. I must press OK and the program will run fine. How can I get rid of the Pop up active X message.

View 2 Replies View Related

Set Textbox Controls

Jan 24, 2007

way of setting the values of textbox controls, the way im using below is very repetitive and has to be run through every time a combobox1 is changed. Im also going to have to add a lot more case scenarios in the short future.

Private Function setform()
Dim Xeng As Boolean

For Each ctl In Me.Controls
If TypeOf ctl Is MSForms.TextBox Then
ctl.Enabled = True
ctl.Locked = False
ctl.Value = ""
End If
Next

View 6 Replies View Related

Accessing Controls

Mar 21, 2007

I have a ListBox in my worksheet "A", and I'm tryin to acces to it... I want to use that ListBox like a log to print the error i have found while running my code. The name of that ListBox is "IncongruenciesListBox".

now if that ListBox was in a userform, i can access to it easily, but if it is in the worksheet how can i change (add more rows) to it?

I tried:

Dim WS As WorkSheet
Set WS = ThisWorkBook.WorkSheets("A")
If added = False Then WS.IncongruenciesListBox.AddItem ("error")

And there is a message saying it cant find "IncongruenciesListBox".

View 6 Replies View Related

Replicate Controls Within Userform

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

Check Box Controls Move?

Jan 7, 2005

I have a spreadsheet with numerous check boxes. Everything looks great when I do a "print preview", but after I close the preview and return to the spreadsheet, a bunch of the check boxes have moved! Have I got a property improperly set, or is it something more sinister? I've looked all over, and can't find an explanation of what the various property settings mean...

View 8 Replies View Related

Looping Controls In To An Array

Oct 20, 2008

I have a userform that as lots of text boxes on.

The text boxes are called "pos1" & "skill1" the number ranges up to 18.

I am trying to put the contence of the boxes on a worksheet using a loop so the 1 will change to 2 and so on.

How do I go about seting the loop up so it changes the name of the control each time.

View 9 Replies View Related

Hide Controls On A Userform

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

Loop Through Controls In UserForm

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

Clearing Form Controls?

Nov 18, 2009

I have two linked ComboBoxes on a form. There are 10 Textboxes populated by ComboBox2’s choice. These controls are situated on two frame controls which are used for visual groupings only. I would like to clear everything except Combo1 when Combo1’s value is changed. ( Combo1 is a filtered key list using the dictionary. Script code)

I’ve written a small sub that is called to clear the textboxes, but its not reliable every time. It seems that if the scroll bar is used, and the user chooses Combo1 choice “NUTS/SEEDS”, the boxes aren’t cleared. In fact it will show the “Walnuts” info in Combo2.

View 4 Replies View Related

Disable Controls On Userform?

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

Disable A Controls Code

May 11, 2007

I have two radio buttons. Let's call them Button_1 and Button_2. They both have code behind the click event.

One of the lines in the Button_1 code makes the value of Button_2 false. If Button_2's value at the time is true, the Button_2 click event fires off and runs through it's code.

How do I disable Button_2's click event in this scenario so the value changes, but the code in it's click event won't run?

I tried application.enableevents = false, but that didn't do it.

View 9 Replies View Related

Clear All Controls On A Form

Jun 8, 2007

Is there a short way to clear text boxes, check boxes and option buttons in one command. I dont want to delete them I want them to be able to accept more data once the operator has finished

View 9 Replies View Related

Hide Form Controls

Oct 24, 2007

I have form controls on my worksheets. How do I hide them? When I hide the row, the controls stay there. These controls don't seem to have that visible property like the VB control.

I'm thinking of using a validation->list instead, but then you don't see the drop down arrow.

View 9 Replies View Related

Does A Group Of Userform Controls Have A Name

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

Adding Variables To VBA Controls

Jul 17, 2008

I have a userform with a large number of textboxes. Say 100. I want to clear them all after the user submits the data to the spreadsheet. Essentially resetting the userform.

Currently I have:

userform1.textbox1.value = ""
userform1.textbox2.value = ""
...
userform1.textbox100.value = ""

Is there a way to change the textbox number to a variable? Something like:

For textboxN = 1 to textboxN =100 Do
textboxN.value = ""
Loop

View 9 Replies View Related

Delete The Controls In The Toolbox Which Are Not In Use

Apr 21, 2009

I have an excel project, and am wanting to delete the controls in the toolbox which are not in use.

Is there a way to find out what is not in use?
in the old VB days, you could just unselect the controls... if they were used it would error out..

View 9 Replies View Related

VBA Commands For ActiveX Controls

Jul 24, 2009

I have made an Excel sheet that uses ActiveX controls (Option Box and Check Box). I have included a couple of screen caps at the bottom of this post to better explain the layout. Here are the specifics:

There is one Option Box Group labeled "InputOptionGroup" with choices labeled: "FirstOption", "SecondOption", "RefundOption" and "NoneOption".

Adjacent to the Option Box is a series of Check Boxes that correspond to the choice made in the Option Box with the exception of "NoneOption". The Check Boxes are labeled "FirstCheck", "SecondCheck" and "RefundCheck". Each Check Box object belongs to the group labeled "OutputCheckGroup".

I do know that the value of the Option Box choices and Check Boxes can be either True or False depending on if it has been chosen or marked, but I do not know how to incorporate these values into the action script. With that being said, here's what I'm trying to accomplish:

...when "FirstOption" is chosen, clear values of all Check Boxes and place a check mark in "FirstCheck".
...when "SecondOption" is chosen, clear values of all Check Boxes and place a check mark in "SecondCheck".
...when "RefundOption" is chosen, clear values of all Check Boxes and place a check mark in "RefundCheck".
...when "NoneOption" is chosen, clear values of all Check Boxes (no furthur action).

Also, there are a couple more requests:Is there a way to lock the Check Boxes from user input? I want the Check Box values to be altered only by the choice in the Option Box.
Take the "GPIN" field, the one on the right is locked from user input. This particular cell references user input from the "GPIN" field on the left. Is there a way to return a blank value when the input field is blank insted of returning a "0"? If you notice, all fields on the right reference blank values as "0".
In the left "Amount" field, I need to display a "$" followed by the value in the input "Amount" field

View 9 Replies View Related

Loop Through Controls On A Userform

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

Create Controls Of A Userform On The Fly

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

Skinning VBA Userforms And Controls

May 30, 2006

I'm trying to skin an Excel VBA userform and all the controls on the form. I found a very good example that skins a userform via a class module. It doesn't however skin command buttons, text boxes etc. I imagine the techniques would be similar.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved