Collection Of Userform Checkboxes?

May 2, 2007

I have a userform with three checkboxes on it. In the manuals I have read (and websites I am learning from) I have encountered articles that give me the impression that it is possible to create a collection of almost any object, and then quickly return properties about the collection as a whole. So, I am wondering, is it possible (or even appropriate) to group the checkboxes on this userform into a collection, and then, with a few lines of code, see if any of them are checked? If this is not possible, or efficient, is there another way to do it? I'll admit that three IF statements are not all that hard to enter, but I know the day is coming when I will make userforms with many more checkboxes in them.

View 4 Replies


ADVERTISEMENT

Add Three Checkboxes To The Userform

Aug 25, 2008

I have a userform that contains 15 labels, each label has Numbers in it each time i click on a label the text is inserted into an excel spreadsheet. I use it as a fast input solution and works well and has done for a few years.

I Now want to Add three checkboxes to the userform
If checkbox One is ticked i want the letter "A" and the number in the label i choose to be inserted into the spreadsheet.
Checkbox Two "B"
Checkbox Three "c"

I would only ever tick one of the checkboxes never two or three so it would be A, B or C

This is the code for The Labels i use

View 13 Replies View Related

Userform And Checkboxes

Nov 25, 2007

a. I m trying to put up a userform that a. select different autofilteroptions (I'm using checkboxes)
b. let the user to do som autofiltering of several workbooks (the workbooks are similar regarding structure and formats).
c. take a copy of the result from the autofilter result
d. paste this in a new workbook
e. go to next workbook, do b. and c. and paste this under the result from the last session.

View 4 Replies View Related

New To Checkboxes On Userform

Apr 11, 2009

I never paid attention to how to make checkboxes work since i though i would never use them but now here I am searching Mr.Excel trying to find simple answers.

Heres the deal:
I got a form that has 6 checkboxes on it, each of the boxes has a different end-value. Kinda like a scoring sytem or quiz form.
check1 = 15
check2= 15
check3 = 10
check4 = 8
check5 =5
check6 =5

then i have a textbox(1) below it that will display the total of "points" that was checked. And eventually the points would be somehow converted to a msge box ( like 20 "you fail") but Im sure theres a post somewhere about that so i'll worry about that later.

Heres what i've been trying to work with. Also why is it i cant get multiples to check is there a property setting that i'm missing?

Private Sub CheckBox1_Click()


If CheckBox1.Value = True Then
CheckBox1.Value = 15
Else
CheckBox1.Value = -15
End If

View 9 Replies View Related

UserForm Checkboxes

Jun 16, 2009

I am making a UserForm with how many hours it takes to complete a project. The format is something like:

Task/Resource Man Hours
(check box) Task name 1 # of Hours to complete
(check box) Task name 2 # of Hours to complete

etc.

I have 20 different task names, and the User enters the # of hours into a textbox. When the form is filled out the User hits OK and the cell adds up the total # of hours and produces that value.

What I want is to have the OPTION to check a box next to each task name (shown above), and for each check box checked, the Cell's value will still show the total # of hours AND have a breakdown listing each task name checked and # of hours to complete.

View 9 Replies View Related

UserForm Changing Value And Checkboxes?

Apr 2, 2014

So im trying to get this userform to work something like this:

User select "Full" or "Half" from OptionButtons.

If "Full" is checked the value of all TextBoxes should be "2" and if checked "Half" it should be "1".

But then they got an option to remove one or two categories. Lets say the user wants to remove category 1 and 2, the value should be double in category 3 and 4, in this case the value should be "4" in both category 3 and 4.

But if the user only wants to remove one category he/she needs to double one of the other three categories.

So what I am looking for is something like the checkboxes are disable or hidden when it should not be an option for them to be used.

The userform that looks like this:
OptionButton1 "Full"
OptionButton2 "Half"

TextBox1 (Category1)
TextBox2 (Category2)
TextBox3 (Category3)
TextBox4 (Category4)

And 8 CheckBox's

The fil: TestForm.xls

View 3 Replies View Related

Loop Through Set Of Userform Checkboxes?

Apr 8, 2012

I have a userform with several checkboxes which relate to different areas to run a report on. In total i probably have 70 odd checkboxes which are set out in groups according to what they relate to (on a multipage on the userform)

I've set out the option to 'select all checkboxes' within a particular group which may contain a certain number of checkboxes (but not all). I'd like my model to run reports to the selected group of checkboxes rather than all of them.

So for example, on page 2 of my multipage i have 5 checkboxes which i've named in the GroupName section in properties as Group1. When my user selects the relevant 'Run Group 1 Reports' button on Page 1 i'd like my model to ru though code using the group of 5 checkboxes relating to Group1.

some of my groups will be for 30 / 40 checkboxes and running it though groups would save a lot of time.

View 2 Replies View Related

Loop Through Checkboxes (userform)

Mar 30, 2007

it's been a while for me so bare with me. I've created a user form with four checkboxes each representing a worksheet. I want to loop through all the checkboxes and those that are checked should be printed.

I'm not sure how to loop through them,

View 3 Replies View Related

UserForm With Multiple CheckBoxes & TextBox (VBA)

Sep 19, 2007

I use this vba-code in the UserForm VBA-Source(I know probably not the world's prettiest code but it works)

Private Sub UserForm_Activate()
CheckBox_ADD = False
CheckBox_Change.Value = True
CheckBox_Cleanup = False
'TextBox_ADD_Line
End Sub

Private Sub OK_Button_Form_Ctrl_W_Click()
Dim NewText As String ' NewText is used to define the input value for: ADD

View 9 Replies View Related

VBA Userform - Warn User If All Checkboxes Are Unticked

Feb 6, 2014

VBA Userform: Warn user if all checkboxes on a userform are unticked.

View 2 Replies View Related

Dynamic Checkboxes On Userform Based On Column

Feb 6, 2012

Every thread I see on Google search for creating check boxes on a user form based on worksheet data says to use a list box, but I really want check boxes. Any code that will create, on initialize of the user form, a check box for each item in Import!B2:B (last row), regardless of the number of items? I am only worried about having about 20 max. Usually, it will only be 5 to 10.

I did try the list box, but it doesn't populate the list box.

Code:
Private Sub UserForm2_Initialize()
Dim lbtarget As MSForms.ListBox
Dim rngSource As Range

'Set reference to the range of data to be filled

[Code] ..........

View 5 Replies View Related

Change Option Buttons To Checkboxes On Userform

Apr 21, 2012

I have a userform with a lot of OptionButtonson it.

(a few pages on the userform * a lot of OptionButtons per page = a lot lot OptionButtons)

I need to change them all to checkboxes ... Is that possible? For example:

Code:
Dim oCnt As Controls
For Each oCnt In myform.Controls
If TypeOf oCnt Is msforms.OptionButton Then
TypeOf oCnt = msforms.CheckBox
End If
Next

Syntax error in line: TypeOf oCnt = msforms.CheckBox

But I always have an error.

View 7 Replies View Related

Userform And CheckBoxes - Filter Data According To Options Chosen

Jan 29, 2013

Have got a userform with four checkboxes representing specific salary bands. What I have tried to do is to filter the data according to options chosen, but the code seems not to be working.

Code:
Private Sub UserForm_Initialize()
With Me.CheckBox1
.TextAlign = fmTextAlignLeft
End With
With Me.CheckBox2
.TextAlign = fmTextAlignLeft

[Code] .........

View 8 Replies View Related

Select Series (lines) In Line Graph By Adding Userform With Checkboxes On A Chart

Apr 15, 2014

I want to add a user-form on a chart, which will have check-boxes that will allow me to select series(lines) that I want see and compare in a chart. Currently my line chart has 24 series (Lines) which makes the chart very difficult to view and looks very busy. How do I add list of check-boxes that will allow me to select one or multiple lines that I want to see at a time?

View 2 Replies View Related

Series Collection Vba

Jan 6, 2010

I trying to code a SeriesCollection in vba, below is the code I have:

' ActiveChart.Name = "Chart1"
ActiveChart.PlotArea.Select

ActiveChart.SeriesCollection(1).Name = "='Chart1'!$C$1"
ActiveChart.SeriesCollection(2).Name = "='Chart1'!$D$1"
ActiveChart.SeriesCollection(3).Name = "='Chart1'!$E$1"
ActiveChart.SeriesCollection(4).Name = "='Chart1'!$F$1"
ActiveChart.SeriesCollection(5).Name = "='Chart1'!$G$1"
ActiveChart.SeriesCollection(6).Name = "='Chart1'!$H$1"
ActiveChart.SeriesCollection(7).Name = "='Chart1'!$I$1"
ActiveChart.SeriesCollection(8).Name = "='Chart1'!$J$1"
ActiveChart.SeriesCollection(9).Name = "='Chart1'!$K$1"
ActiveChart.SeriesCollection(10).Name = "='Chart1'!$L$1"
ActiveChart.SeriesCollection(11).Name = "='Chart1'!$M$1"
ActiveChart.SeriesCollection(12).Name = "='Chart1'!$N$1"

However it it giving the error "Object denfined or Appication denfined"

View 9 Replies View Related

ComboBoxes Collection?

Jun 20, 2006

I am using the following code to determine whether a given range is the linked cell for a Combo Box by looping through the shapes collection.

Function LocateFormControl(OverRange As Range) As Shape
Dim objTemp As Shape
For Each objTemp In OverRange.Parent.Shapes
If Left(objTemp.name, 6) = "Drop D" Then
If WorksheetFunction.Substitute(objTemp.ControlFormat.linkedcell, "$", "") = WorksheetFunction.Substitute(OverRange.Address, "$", "") Then
Set LocateFormControl = objTemp
Exit Function
End If
End If
Next
Set LocateFormControl = Nothing
End Function

However, when I use this code on big worksheets with many other shape objects (such as Comments), the program runs very slowly. Is there a ComboBoxes Collection that I could use to avoid looping through all shapes on the worksheet, or is there a different, faster way to run this code?

View 2 Replies View Related

Defining A Variable As New Collection

Dec 7, 2008

I have a piece of code I am using to important data from a text file. The code works fine but I am having a hard time understanding how defining a Variable "As New Collection" works. I have tried to research on numerous websites dedicated to excel but had no luck finding any further information.

I have executed the code line-by-line over-and-over and believe what the "new collection" does is it creates some type of external database that is hidden within excel (that's just my guess). I have attached a sample file and a text file with dummy data if needed to see how the code is working.

View 4 Replies View Related

Deleting Keys From A Collection?

May 26, 2009

Is there a way to remove a value from a collection after I've added it.

I have simplified the code I'm using to highlight what I'm trying to do.

Basically I'm adding 10 keys to a collection and want to remove the last one. There is a reason for this.

View 3 Replies View Related

Looping With/Through Object Collection

Oct 5, 2006

Im workin with a spreadsheet.. At the end of this script you see how i am putting "a" in R11C33, well I want to put the contents of my workbook C3 instead. I just dont know how to do it. After it does that I need it to move on to cell C4 and put it also in r11c33...

View 4 Replies View Related

Histogram Data Collection

Oct 27, 2006

I have a large table (20,000 plus entries) and I need a way to pull out data that matches criteria in buckets.

For example:
April data (column B) that is from 0 to 30 (column C)
April data (column B) that is from 31 to 45 (column C)
... 46 to 60
... 61 to 75
... 75 to infiniti

Then do it again for May, June, July, etc. I have used DCOUNTs to pull this type of data, but it's a bit cumbersome. Any other ways to pull this type of data from the table?

View 3 Replies View Related

Collection Of Objects - Add Method

Jan 28, 2007

I am attempting to create a double-entry accounting system and am having trouble with my Transaction class (clsTransaction). As each transaction will consist of at least two entries, I have included a Collection in clsTransaction that will accept Entry objects (clsEntry) as items. The Add method appears to go ahead without a hitch, but when I output the values from the Entries I get the same values for all items in the collection. Here is the code I've been working on.

The Transaction Class
clsTransaction - (Class Module)

Option Explicit

Dim mcolEntries As Collection
Dim msDescription As String

Private Sub Class_Initialize()
Set mcolEntries = New Collection
End Sub

Public Sub Add(eItem As clsEntry)
mcolEntries.Add eItem
End Sub........................

View 3 Replies View Related

Static Collection Of Textboxes

May 31, 2007

I have a routine that creates a collection of textboxes to simplify adjusting their positions: ...

View 9 Replies View Related

Name Each Name Series Collection Of Chart

Feb 7, 2008

I hope this passes muster. Anyways, I wrote some VBA code to handle an embedded chart in my workbook. I named the chart "Data" but i'm getting some unexpected trouble from VBA. Last time I worked on this set of code, it ran fine. When I try to run it now, it is throwing up an error: "1004 Unable to set name property of series class" The .name function is not working correctly but everything up till that point is working correctly. I have 5 sets of data in this chart also ....

View 9 Replies View Related

Separate Sheet Data Collection

Oct 31, 2009

I have a separate sheet(Coverage.jpg) that records some data which at this stage has to be entered manually.

The data comes from another sheet(officers.jpg), each row is 1 flight and the days are usually separated by a blank or grayed row.

I was wondering is there a formula that will collect the data automatically.

As you will see on Coverage.jpg it is broken down into Number of flights(per day), how many flights were covered by 2 or more officers and how many covered by 1 officer.. and then the graph generates off the data.

Is there a formula or something that will enter the per day data?

I have just added some false data to show you how some things get recorded.

View 14 Replies View Related

VBA - Are Named Ranges Part Of Collection?

May 27, 2014

Writing up some code, and I have a workbook with many named ranges. Question is simple...

Are named ranges a part of a collection object that I can use?

Looking to do something like:

[Code] .....

How to determine collection objects on my own in the future!

View 2 Replies View Related

Survey Collection - Up / Down Spin Buttons

Jul 10, 2014

I'm creating a spreadsheet to collect survey data and how I have it set up is this:

Question 1 is a simple yes/no/maybe question - it uses an ActiveX spin button that the user presses up/down to increase/decrease the total. It looks like this:

Private Sub Yes_SpinUp()
With Range("C3")
.Value = WorksheetFunction.Min(15000, .Value + 1)
End With
End Sub

Private Sub Yes_SpinDown()
With Range("C3")
.Value = WorksheetFunction.Max(0, .Value - 1)
End With
End Sub

Cell C3 is where I keep track of how many people answered yes

The button is called "yes" under the button properties

So basically, I have one privatesub for spinning the value up and down. It works fine and is easily copy-paste-able for other answers, it just takes up a lot of space. I'm wondering if there's code I can write to handle the up/down in one sub. If not, i'll stick with what I have.

View 6 Replies View Related

Add Series Collection From Dynamic Sheets

Jul 29, 2014

I've created one file: Mappe1_results.xlsm

This file ask in another file "Mappe1_ground.xlsx" for "B" and "N". Now one new sheet is created with the name "month-2014" and shows me which Category (B) is how often referred in one month. After that one chart is created for a better representation. This can be done for every month (which month is selected by the user over the button "Auswertung" in Sheet "Tabelle1").

Now I have a few problems / requirements:

1. If one user is using (maybe) Jan as his selected month, in the sheet "Auswertung" should be one duplicated chart of the Jan Chart., with no other (previous) series. Because Jan has no previous conditions (prev. year).
1.1 If one user is using another month (maybe Feb), in the sheet "Auswertung" should be one chart with both series of Jan and Feb and so one (for the other months). So that in "Auswertung" the chart is one comparison over the months. Only Feb/Mar/Apr/May/Jun/Jul/Aug/Sept/Oct/Nov/Dec have one prev. month.

For example: If one user write "Apr" into the inputbox and "Mar" is in the sheet existing, so in the chart of "Auswertung" should be April and March shown.

Some functions are set in my macros, but the problem is that the results are not equal between the sheet "Auswertung" and maybe "Jan-2014" or "Feb-2014". Because in "Auswertung" we need called all Categories (they can be found in "Referenz" - A).

All what I want is in "Auswertung" one chart with all present categories of "Referenz" - A and the series of the created sheets by the user.

2. The next problem is, every created sheet has one legend "Anzahl im ..." - this legend of every series should be shown in "Auswertung", too. So that we know which color is for which month, u know.

View 2 Replies View Related

Possible To Change The Index Numbers Within A Collection

Feb 1, 2010

I have created a userform that upon clicking a commandbutton adds a line of 4 textboxes. Everytime the user clicks the commandbutton a new line of textboxes is created. The 4 textboxes in each line are described by a class (hope I am using the terminology correctly). And each instance is saved in a collection. The problem is that I am giving the user the ability to insert a new row in between two existing rows.

When this happens, I need all of the index numbers to re-order so that they are consecutive from the top of the form to the bottom. Example: The user enters 6 rows of data and then realizes that they missed an item that needs to be inserted between rows 3 and 4. Currently the rows are indexed 1 to 6 with 1 being the row at the very top of the form and 6 being the row at the very bottom of the form. If I insert a row in between 3 and 4 I will end up with the index numbers going from top of the form to bottom (1,2,3,7,4,5,6). Is it possible to reorder the index numbers so that the inserted rows index number will be 4 and each row after that will go up by one?

View 9 Replies View Related

Entering X And Y Values To Series Collection?

May 19, 2013

I have a VBA module in Access that extracts data and copies to an Excel spreadsheet. Every time I run the code additional data is extracted and displayed on a chart together with previous data. When I enter values to the series collection the first axis be it X or Y is entered correctly but the second axis produces error 1004 'unable to set XValues property of the series class' If I swap the lines of code around the error switches to 'Values' (y axis)

wchart.SeriesCollection(NoCurves).Values = wsheet.Cells(9, 3 + (3 * (NoCurves - 1)))
wchart.SeriesCollection(NoCurves).XValues = wsheet.Cells(8, 3 + (3 * (NoCurves - 1)))wsheet.Cells(a, b))
wchart.SeriesCollection(NoCurves).Name = wsheet.Range(Cells(6, 2 + (3 * (NoCurves - 1))), Cells(7, 2 + (3 * (NoCurves - 1))))

View 2 Replies View Related

Split String In Collection Into 2D Array

Jul 30, 2013

I set out this morning to count duplicates in an array and report a succinct list.... so I went down the route of using a collection with keys to do this.

1. Is there a better way? Else
2. split my collection values? I'm a bit stuck.

I have a series of values in a collection like this

: Item 2 : "Spam|01/07/2013|1" : Variant/String
: Item 4 : "Chips|01/07/2013|2" : Variant/String

So I have 3 key pieces of data delimited by a pipe sign -

Product | Date | Number of Occurrences

Item 4 is of interest to me because it occurs twice.

How I can turn those collection values into something I can work with, else another approach to sum rows in an array which are duplicates (if you only look at 2 columns).

View 6 Replies View Related







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