Ensure User Selects Radio Button Before Adding Information
May 27, 2014
I have a userform for inputting information to a spreadsheet using the code below. It works fine however if the user does not select a radio button to select a score its saving the rest without it. How can I ensure the user selects a score,,,, ob10, ob8, ob6, ob4, ob2, obna.
I have created a survey in excel 2003. It has 70 questions on it and the user responds to the questions by clicking on a radio button. There are 4 radio buttons within a group box for each question and the user will select one of them.
At the end of 'sheet 1' with all these questions on, i have a button which the user presses to proceed to 'sheet 2'. When they press the button i want to ensure is that all questions have been answered ie: 1 of the radio buttons is selected for every question.
If one of the questions isnt answered then a pop up box will appear to tell the user they have unanswered questions and then the vba code will exit and the user stays on the question sheet (sheet 1). If all the questions are answered then the user will move to 'sheet 2'. (the reference cells for all the groups of radio buttons are within column G on sheet 1).
Say you have two columns, A & B. Each cell in column A consists of an identical drop-down menu of four possible choices. Each cell in B is a random number. I want to sum the cells in B according to what the user selects from the drop down in column A. If A1=A2="BILL", I want the sheet to add B1 and B2. IF A1=A3="BILL", and A2=A4=TOM, I want the sheet to sum B1 and B3, then sum A2 and A4. So, conceptually, I guess column A acts as a group identifier, and I want to sum B by group.
My worksheet with macros gets messed up when a user selects either multiple cells from column F or selects multiple cells in any one row (but only if column F is included) in the range C17:O116 and hits "delete". I will either do an exit sub, an application.redo, or something similar so that this doesn't happen, but I don't know how to write the code to trigger these events. So I need a way to determine "if the user selects multiple cells in column F and hits delete" or "if a user selects multiple cells in any row from 17 to 116 that includes the cell in row F, and hits "delete.""
Set Rng = Range("F17:F116") Set rng2 = Range("K17:K116") Set Rng3 = Range("L17:L116")
The code below adds the date to D:D once the user enters data in B:B and then adds the time when the user selects from a dropdown in C:C. When they have finished the task they enter anything into F:F and then it enters the end time in G:G.
This works well except for one flaw and one modification that I can't get to work. I have found that people retrospectively change the activity in C:C which causes the start time to change. I would like to avoid this hapenning if possible by putting some code in to stop this. Also I would like the times to be related to the push of a button on the sheet and therefore need different code.
Code: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count > 1 Then Exit Sub If Not Intersect(Target, Range("B2:B900")) Is Nothing Then With Target(1, 3) .Value = Date
I'm wondering if someone can help me with this. I am using the excel calendar control and trying to activate it when a user selects a specific cell "C3". I can get it to activate when I move off the cell, but it's not working when they click on the cell.
Sheet1 Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("C3")) Then Call OpenCalendar MsgBox "Calendar" End If End Sub
Userform2 (I have this code under here)...............................
I have a chart that's being updated with different values when I cklick on different radiobuttons. When the cells that the radio button refers to is empty or the calculation in the cell have an error it pops up a message that I need to click OK to go on. Is there a way to stop these alerts by writing a script that shuts the alert messages off during each click?
I'm making a worksheet where the user has the options to select "yes" or "no". I used active x radio buttons because I feel they are more flexible. The problem I'm running in to is, what happens if there is an "unknown"? I can't find a way to "deselect" a radio button?
I tried using 2 checkboxes using the following Checkbox 1:
If CheckBox2.Value = True Then CheckBox1.Value = False End If
If CheckBox1.Value = True Then CheckBox2.Value = False End If
The problem with this is, you have to deselect one checkbox before you can select the other. It works, but itís a little more cumbersome then I was hoping. Is there a better solution?
When I select the binoculers by project the window we are disucssing with the radio button comes up (after the project number is added and sendkey to select filter - only shows one radio button). Attached is the source code of the original window and a snapshot of what it looks like.
First window - I currently have the code going to the project area (where we cannot type anything) then using sendkey to tab and enter to select the binoculers.
New window - only one radio button shows after you type a project number than hit filter.
First Window.xlsm Original Window source code.txt new window.xlsx New window radio source code.txt
I am looking at designing a simple radio button system which allows me to fill an adjacent cell with values from a certain column - so in the example, column C is the total value, and columns D-F will ideally have a radio button which a user can just click to select the value.
I have code in my macro that outputs a radio button for every project that is entered into the database. All radio buttons are part of the same group. I know how to give the radio button an caption name but I do not know how to give the radiobutton an actual name that I can call to. How can I do this in excel macros?
I am building a form and want to display (or activate) a drop down list only when an radio button is active. I have 4 radio buttons and want to link to to 4 different drop downs. But only have the drop downs active if the button is clicked.
I have a form (worksheet with controls embedded in) and the form changes color depending on what the user clicked, problem is that button colors and cell pattern colors don't quite match.
thought I solved it by making the buttons backstyle = transparent. However, as soon as radio button was clicked, transparency was lost.
I have named the range of the form "FormGround" so that when Service 1 is select, the Form turn a different colour. I have my subsequent buttons change to that same color as well (using the cell's color index number.
I'm trying to create a form using radio buttons from the "Forms Tool Bar" and not sure I shouldn't be using the "Control Tool Bar"
I've got multiple buttons and wanted to group them so i used the "Group Box" from the Forms tool bar but now there's a box around the buttons (I've turned off Printing for the box) that gets in the way of other text on sheet. I did some searching and thought I read where you could also use the drawing tool bar and draw a rectangle around the buttons which would then let them operate independent of other groups of buttons but that doesn't seem to work so I'm guessing I imagined it. I also noticed that if you don't draw the "Group Box" around the hole radio button box, they don't work with others in the same "Group Box"
I'm not sure if I should use the buttons in the "Control Tool Bar" but I'm thinking I should so that I have the flexibility should I decide to do something different in the future. I'm thinking about using the buttons to hide a sheet as well as select the sheet for printing, but for now one hurdle at a time.
Lastly I tried looking up some information on how to get the "Control Tool Bar" radio button to behave similar to the "Forms" version of the button (i.e. click the button and it appears to alternate from other buttons in the group), however when I place my mouse over the button it selects it rather than letting me change it's state from true to false.
I have an excel file containing 50 sheets which we use as an accreditation test. Each sheet contains one question to which there are several possible answers. These answers (for example, A, B, C and D) are option buttons and when a user selects one, that selection is recorded as their response which is then marked. After answering a question they click a NEXT button to move on and as they move on the previous sheet (question) is hidden so they only ever see the current question sheet.
This has worked well for us for a few years, but we have just noticed some odd behaviour on ONE SPECIFIC sheet. The option button the user selects on that sheet (it is actually question 13 in the sequence) is not stored after the test is completed. However on every other sheet, the selection is stored fine - just this one sheet. The properties of all objects on the rouge sheet are the same as the other sheets. I have duplicated a working sheet and tried replacing the question 13 sheet to try that, but the problem persists.
I tried deleting that Q13 sheet and running the test without it and the same problem occured but this time on the preceeding sheet (question 12) which suggests it is not the actual sheet that is causing the problem.
I have a worksheet (attached) that lists various clients in columan C. Column E lists whether each of the clients listed in Column C are 'Existing Business' or 'New Business'. I require a user form that has three radio buttons (one to select 'New Business', another for 'Existing Business' & one for 'All').
When Selecting a radio button, (e.g. 'Existing Business'), I need all clients listed in Column C of the worksheet that also have 'Existing Business' in Column E to be listed in a ListBox on the UserForm (with the second radio button allowing the text box to list 'New Business' and the third to list both Existing and New).
I have two combo boxes: One for entering the Year, and one for the month. I can produce a message if the user leaves either box blank but I want a message to apear it the user selects a year AND month less than the current year (iYear) and current month (iMonth). I therefore need an AND statement between the two criteria but i dont know how to do it.
'....First Checks the Comboboxes arent blank then below Checks a future month/year secection is chosen
ElseIf YearBox.Value = iYear & iMonthbox < iMonth Then MsgBox ("You may not enter Data before the current Month") Else '...... Run main code here
I am trying to do is create and link and user form to put information into a spreadsheet. Layout of the form is done but I'm not sure how to link the cells. Also, there are some cells pre-filled that should show up on the form but I don't want the user to change those (columns a,b,c - guessing i will protect those).
Would be great if the user could navigate rows within the form so I included buttons for previous and next entries (this feature would be very similar to the built-in data form that excel provides). My sample spreadsheet is attached.
In the attached file, I want to have the user select a receipt # and have it copy the information, for that receipt from the log, to the receipt tab. Then I want it to print the receipt. The macros that are in the file already, were created before I added a column for Receipt No., and don't ask for user input. File is attached.