Populating Combobox From Different Sheet?
Nov 6, 2012
I have an ActiveX Combo box - and Im trying to fill from a 2nd sheet (same workbook). I can get the box to work if the data is on the same sheet but what to I put in the ListFillRange to get it to populate from another sheet ?
View 2 Replies
ADVERTISEMENT
Mar 1, 2007
I am trying to populate a combobox located in sheet1 with data from sheet2.
View 3 Replies
View Related
Dec 14, 2012
Below is the code for completing Sheet 1 using various comboxes on a User form. There are only 15 lines to which values can be entered on sheet 1. After the 15 lines have been completed, I would like to begin adding new data to sheet 2. However, I'm not really sure where to begin in terms of setting up a counter and then calling sheet 2 once the counter hits my limit. Sheet 2 is exactly identical to sheet 1 in layout and also has 15 lines.
Private Sub btnAdd_Click()
' This button will add medication info to excel worksheet
'RowCount will help find next empty row
[Code]....
View 1 Replies
View Related
Mar 30, 2009
Am trying to get dynamic population of 2nd combobox based on match from criteria in combobox 1.
if column a = bears and column b = colours of bears then
when I select bears in combobox one, combobox 2 would populate with colors of bear.
I am think of having a combobox 1 change event that evaluates each row in a specific range (does it match the criteria?) if so, then add 2nd cell (column b) of that row to the combobox 2.
I know it would probably involve match and offset, add item and loop, but I am not sure what the syntax is.
View 9 Replies
View Related
Jun 1, 2007
I have a combobox that is not populating correctly. The design of it uses an existing list (which changes every month) to populate the contents of the combobox. I want the user to be able to select a location from the list if it is already on the worksheet, rather than having to key in the location name for every single record. This Sub worked just fine and dandy for me until I deployed the workbook to the end user. Then this particular combobox decided not to work.
I have been over this code many, many times and I am almost positive that it's just a matter of my not being able to see the obvious. Perhaps another set of eyes looking at the code will be able to see what I can not.
Sub get_Locations()
Dim allCells As Range, Cell As Range
Dim noDupes As New Collection
Sheets("Main").Select
' get the first from last row #--the last row is a row of record counts and sums.
endRange = ActiveSheet.UsedRange.Rows.Count - 1
ComboBox1.Clear ' This will clear the combobox.
If endRange 65536 Then ' If the row number is not the end of the worksheet, _
there must be something already on the worksheet, so build the list.
On Error Resume Next
' Get unique values in range by checking each cell in range.
For Each Cell In Range("D12:D" & endRange)
noDupes.Add Cell.Value, CStr(Cell.Value)
Next Cell
On Error GoTo 0
' Sort the collection alphabetically within the combobox
For i = 1 To noDupes.Count - 1
For j = i + 1 To noDupes.Count
If noDupes(i) > noDupes(j) Then
Swap1 = noDupes(i)
Swap2 = noDupes(j)
noDupes.Add Swap1, before:=j
noDupes.Add Swap2, before:=i
noDupes.Remove i + 1
noDupes.Remove j + 1
End If
Next j
Next i
' Add items to combobox in their new alphabetical order.
itemIndex = 0
For Each Item In noDupes
UserForm2.ComboBox1.AddItem Item, itemIndex
itemIndex = itemIndex + 1
Next Item
Else ' otherwise there's no list to populate and the default row is 12
endRange = 12
Range("A12").Select
End If
End Sub
And just for the record, all object references (cell ranges, comboBox, etc.) are valid and correctly named, so I know it's not there. I also recognize that I have overspecified things by using "UserForm2", but I have done that in the hopes of finding the problem. And the code does execute at the proper times, populating "noDupes" correctly. The problem seems to occur near the end, in the block where noDupes is added to ComboBox1.
View 9 Replies
View Related
Jul 3, 2006
I have a spreadsheet with loads of different columns on it, I am using a userform to control the spreadsheet. I have one form that allows me to add data to the spreadsheet and another that allows me to search it.
If one of my colums was a list of "counties" what I want to do is to have a combo box that displays all the counties listed so I can pick a specific one and and search it.
This I can do, the problem arises if a new county is added to the spreadsheet it will not be displayed in the combobox because I am using the additem "....." function to populate the box.
View 6 Replies
View Related
Feb 27, 2014
I have two types of lists that has to be populated into comboboxes. First type is in a column with a header - lets say A1:A20. For them I`m using a following script:
Code:
For Each cell In ThisWorkbook.Sheets("NACE").Columns(1). _
Resize(Rows.Count - 1).Offset(1). _
SpecialCells(xlCellTypeConstants)
UF1.industry.AddItem CStr(cell.Value)
Next cell
With them all is fine until I need to start for example from row 26. (lets say range to populate is T26:T32) Then I`m lost. changing Offset(1) to Offset(26) doesn't work and I`m getting an error. That however can be handled with a workaround - creating another list that starts from the top. So I gave up on solving that. I need to populate a list from a range that is a row - B5:B20
I've adjusted the script to:
Code:
For Each cell In ThisWorkbook.Sheets("prod").Rows(5). _
Resize(, Columns.Count - 1).Offset(, 1). _
SpecialCells(xlCellTypeConstants)
UF1.PS.AddItem CStr(cell.Value)
Next cell
Because of some strange reason the script doesn`t see the number 1 in cell B5 and unless there are some more numbers in the following cells, it gives the "no cells found error".
View 9 Replies
View Related
Aug 1, 2006
I'm sure there is an extremely simple answer to this question, but I can't seem to find it anywhere.
I am adding a combobox to a userform using the controls toolbox. How can I populate the combobox without a macro?
I do not want to add extra code to the UserForm_Initialize() event because this would just add clutter (I have seen numerous examples using .AddItem)
I would like to just change the combobox by hand.
View 9 Replies
View Related
Sep 12, 2006
I have a userform with a combo box that is populated from a list in a sheet called Clients. The userform is in the same workbook as the Clients sheet. This workbook called "Client List.xls" and is set to be hidden from view. I've created a menu bar icon that loads the "Client List.xls" workbook, and on open runs the initialize procedure. The problem seems to be caused by the "Clients List.xls" being not the active workbook. Is this the case? Is there a way around it? If I unhide the workbook and make it the active workbook, the code works great.
Private Sub UserForm_Initialize()
Dim rngClients As Range
Dim wsSheet As Worksheet
Set wsSheet = Workbooks("Client List.xls").Sheets("Clients")
With wsSheet
.Range("a65536").End(xlUp).Select
.Range(Selection, "A1").Select
End With
Set rngClients = Selection
With cmbClients
.RowSource = rngClients.Address
.ListIndex = 0
End With
View 3 Replies
View Related
Jan 26, 2014
I have built a Userform that is for a Liquor Inventory. I would like to scan each bottle's UPC Code and pull it from a range list that is set up in (Combobox "UpcBarCodeBox"). That information is stored on a sheet "Liquor & Wine Inventory" in Column "A" (Unsorted). Column "B" is the name of the liquor which is also the column that everything is sorted in alphabetical order. What I would like to do is populate several textbox's that I have set up so that I can input missing data or data that needs to be updated. The problem is I would LOVE to keep the list sorted by Liquor Names (Column "B") and not by UPC Bar Codes (Column "A"). From my research I have found that Index and Match might be the way to go but I can't seem to get it to work right. Since I am still learning VBA, Some things still escape my grasp.
VB:
Private Sub UserForm_Initialize()
Me.UpcBarCodeBox.List = Worksheets("Liquor & Wine Inventory").Range("A5:A205").Value
With ComboBox2
[Code]....
View 9 Replies
View Related
Sep 3, 2009
I have a userform with comboboxes and listboxes etc. The comboboxes have drop down lists which are populated from data in columns from a worksheet.
1.) During the execution of the userform, a value is selected from the combobox, which is place in a column on another worksheet. So far so good. If I select the same value again, nothing shows up in the row below the first selection. If I choose a different value it shows up. I have tried using different properties of the combobox but have not been able to get around this.
2.) I would like, when the excel file is opened that the userform is ready to go, ie enter data. I have tried putting the
Private Sub Workbook_Open()
UserForm1.Show
End Sub
in "ThisWorkbook" module but have had no success with it.
View 12 Replies
View Related
Jan 24, 2013
I am having an issue with some code that I am using. I am using the code below to pull a list of folders within a specific directory. I run the code two different times, once on initialization and then again when the combobox values change. The code works well when it is run in initialization. However when the combobox is changed I wind up getting all of the folders listed in the combobox twice. I do not understand why this part of the code gets executed twice.
Here is the initialization code
Code:
Dim FileList, FilePath As Variant
mypath = "c:"
MyName = Dir(mypath, vbDirectory)
[Code].....
View 3 Replies
View Related
Jan 25, 2014
I have built a Userform that is for a Liquor Inventory. I would like to scan each bottle's UPC Code and pull it from a range list that is set up in (Combobox "UpcCodeBox"). That information is stored on a sheet "Liquor & Wine Inventory" in Column "A" (Unsorted). Column "B" is the name of the liquor which is also the column that everything is sorted in alphabetical order. What I would like to do is populate several textbox's that I have set up so that I can input missing data or data that needs to be updated. The problem is I would LOVE to keep the list sorted by Liquor Names (Column "B") and not by UPC Bar Codes (Column "A"). From my research I have found that Index and Match might be the way to go but I can't seem to get it to work right.
Code:
Private Sub UserForm_Initialize()
Me.UpcBarCodeBox.List = Worksheets("Liquor & Wine Inventory").Range("A5:A205").Value
With ComboBox2
.AddItem "0"
.AddItem "1"
.AddItem "2"
.AddItem "3"
[Code]....
View 3 Replies
View Related
Mar 19, 2014
I have 100 combo boxes on an excel sheet, they are divided in three sets (1-25, 26-50, 51-100). Each set has the same value within the set, but is different from the other.
Right now I am able to populate the combo boxes using the following code
Code:
ActiveSheet.ComboBox1.AddItem "Value1"
ActiveSheet.ComboBox1.AddItem "Value2"
ActiveSheet.ComboBox1.AddItem "Value3"
^ This is time consuming and error prone. Is there a way I can use a variable to populate the combo boxes?
I have been able to find the following code, but it does not work.
Code:
Dim ComboBox As ObjectFor ComboBoxCalc1 = 1 To 25
Set ComboBox = ComboBox(ComboBoxCalc1).Select
ActiveSheet.ComboBox(ComboBoxCalc1).AddItem "Value1"
ActiveSheet.ComboBox(ComboBoxCalc1).AddItem "Value2"
ActiveSheet.ComboBox(ComboBoxCalc1).AddItem "Value3"
Next
View 6 Replies
View Related
Mar 22, 2014
I have a Userform where I use a ComboBox to populate raw A from a worksheet.
I use this form to update new data that relates to the selected item in the ComboBox.
In that user form, when I select an item from the ComboBox, I idetifay it's raw and display the data from columns B,C...to I in text boxes on the Userform.
I then set the "Enable" property of the text boxes that has data to "False" so that field cannot be updated again.
What I do today is if all the fields where updated, a message box will say "All fields are full" and I clear the form.
Now I want to improve my selection by removing items from the ComboBox if all the "needing update" columns are field.
By this I want to filter out the items that where already updated before and only show the ones needing update.
Here is what I have, I need to change the UserForm_Initialize section so it will only show the rows needing update.
Code:
Private Sub UserForm_Initialize()
'Populate "Cards" Combobox.
Dim rngCards As Range
Dim ws As Worksheet
Set ws = Worksheets("Rejects")
[Code]..
View 7 Replies
View Related
Aug 10, 2009
Sheets("Sheet1").Shapes("ComboBox1").Select
Selection.ListFillRange = "='Sheet1'!$b$15:" & comborange & ""
where comborange = cell reference of the last cell in my range..
I have moved this combo box to a userform now and I'm trying to populate the box via one of the userforms triggers.. My problem is I can't figure out the syntax to select the combobox on the userform.. it doesn't seem to be handled the same way as when it was on the worksheet..
View 9 Replies
View Related
Dec 25, 2009
I have a problem involving two combo boxes in a user form.
I need to populate different “lists” to combo 2, based on a selection in combo 1.
I browsed through the forum but could not find any solution that made sense to me.
Here are the specifics:
Combo 1 (called Cbo_Act) is populated with a list based on a named range in one of the sheets. The range is named “activity” and holds 2 records (“Income” & “Expense”).
This list is loaded as part of the form initialization.
If the user select “Income”, I need combo 2 (called Cbo_Act_Type) to show a list of various income types (derived from a dynamic named range called “Income_type”) and if the user selects “Expense”, I need the same combo box (Cbo_Act_Type) to show a different list, specifically – a list of various expense types (derived from a dynamic named range called “Expense_type”).
I know that this should be with a Cbo_Act_Change () routine, but for the life of me, I can’t figure out how to do it.
View 9 Replies
View Related
Dec 30, 2011
I am trying to populate a combobox (CboMilestones) based on the project number that appears in CboProjNum. I need the values of certain columns to be added to CboMilestones. My spreadsheet is laid out in a paticular order based on a SQL upload that I will have to perform (1st column = project number, 2nd column = milestone 1, 3rd column = must be blank, 4th column = forecasted date, 5th column = actual date, 6th column = Milestone 2, 7th column = blank, 8th = forecasted date, 9th column = actual date....this repeats all the way to milestone 160) I need CboMilestone to populate with all the milestones on the row of selected project number, and then I need TxtADate and TxtFDate to display the dates of the selected milestone for the selected milestone.
Below is a pic of my spreadsheet and a pic of the code i have so far.
[IMG]
[URL]....; base64,
iVBORw0KGgoAAAANSUhEUgAABLMAAALMCAIAAACQRGcbAAAgAElEQVR4n
Oy9W3TcxoHnDdmxdXmi33TO98KTp9nZmbN9xp+
/1cwoy86MM0PvjGc7m3jNxLkgjpzh2DMxkmhsbsaJkChKuFnHgmM7pmzJhmXKbut
iQTIlU9dGJFmkJEaCKImiRFEERV0oiZ
FAXWzqWt9DNUEQKBSARjcbTf5/53d40NWFQgFEs+
vPAroF4SvHha8cF77eJ3y9T/jWOeHJ88KT56c9ddFW+Oc/
[Code]...
View 1 Replies
View Related
Jul 25, 2014
I'm trying to do some userform development with multiple dependent comboboxes, but I am having trouble populating the third and last combobox. First, I populate the 1st combobox on the userform initialization. I can get the first 2 comboboxes to populate correctly, but I can't seem to get the 3rd combobox to populate correctly.
The 3rd combobox takes the selection from the 2nd combobox and searches column "A" in the worksheet "Chassis Specs" and populates the 3rd combobox with data from column "B", there will be repeat items in column "A", but all those occurances should populate the 3rd combobox with the data from "B".
I am attaching my whole workbook.
Chassis Specs Info_Build_REV B.xlsm
View 14 Replies
View Related
May 5, 2009
Error Help.xls. An example is attached. If you open the attachment, you can see that I'd like to choose a date from the combobox and have the corresponding "date code" (that's what I'm calling it - it's for a different, more complex purpose) appear in the text box. For this to happen, I'm using the following
View 2 Replies
View Related
Oct 26, 2003
I am creating a Userform and one of the elements on it is a combobox where the user has to select their name. On the same Userform, I want to have a textbox (or listbox or another combo box if necessary) which will show the users default cost centre based on the initial combobox selection. I've tried doing this various ways, but I can't get the textbox to update when the combobox selection changes.
View 7 Replies
View Related
Mar 14, 2013
i'm having in excel- I'm looking to populate rows in 2nd tab based on the data entered in the 1st tab. The rows to be populated in the 2nd tab resides in the 3rd tab. So a match has to be made on the data entered in the 1st tab. When a match is found on the 3rd tab then the corresponding rows from the 3rd tab should be listed on the 2nd tab.
I have an example.xls attached for clarity.
example.xls
View 4 Replies
View Related
Jul 28, 2013
I have a master list. I want to create an excel sheet that will follows when I key in the code number according to the master list all the rest of the value in the master list will automatically populate accordingly into their respective sequence into the created excel sheet.
Eg.
Master list
A B C D
0001 Lucy 8 Walton primary
0002 Rachel 9 Dermouth primary
The created excel sheet
Code 0001
Name Lucy
Age 8
School Walton Primary
I want to key in the code 0001 and the rest of the value will auto populate from the master list into the created excel sheet. The master list data go in accordance row by row. That means the master list is listed in a sequence where all the related value for the particular code into one row only.
View 14 Replies
View Related
Oct 29, 2008
I am trying to total up by a Range of Dates some information from one page to another through VBA. I am having a tough time with this one, I can't seem to get the correct information over to the other page.
I have successfully been able to transfer the data via a series of SUMIF statements, but it really is very inefficient and takes a while when the data repopulated by another program. So I am trying to do it via VBA.
View 5 Replies
View Related
Jul 11, 2013
I'm attempting to build a large (let's be honest for a second this is going to be enormous) spreadsheet for a project I'm working on and TBH I'd rather not do it by hand. With the scale of numbers I'm working with I'll miss something and it'll take forever.
Here's the deal:
I have 5 variables. They must add up to 100. I need to populate their area with all combinations/permutations of said variables in steps of 10. I'd like to do it in steps of 5 but I'm afraid that'd be too large.
Like so:
A
B
C
D
E
Sum
100
0
0
0
0
100
[Code] ....
It's been a while since I was in a math class dealing with combinations and permutations, so one of my questions is, how exactly would I phrase this mathematically?
View 3 Replies
View Related
Jun 22, 2012
I have a workbook with two sheets. Sheet 1 has raw data that contains contacts with multiple statuses. I need to pull out only the contacts that have a positive status and put them into Sheet 2.
I would like there to be no spaces between the contacts in Sheet 2. I'd also need all of the data pertaining to each positive contact (so not just their name, but all of the data in the row that relates to the contact).
View 3 Replies
View Related
Aug 28, 2013
I am trying to auto-populate a table with data looked up from another sheet. The functions I have used are: Data Validation, vlookup, ISerror and if functions.
Cell B4 in sheet2 uses Data Validation to pick data from sheet1 (in this case "tax") and auto populate the table with the information- Job type, Name, employee type and Job title. If i change from Tax to HR, the table should get auto-populated with the correct information.
I have setup vlookups but I am unable to get it working. I am a novice at using vlookups (I learn it just 2 days ago) and am struggling to get it work. I am not even sure if vlookup is the right tool to get this job done.
View 12 Replies
View Related
Jan 14, 2010
I need help to create a formula that would grab data from one sheet and populate another sheet based on the employee that is selected from a drop down list.
Attached is a draft of what I am looking to do.
Basically this would allow us to enter employee variances from several employees on one sheet and get a detailed break down of their history on another sheet.
View 8 Replies
View Related
Apr 22, 2013
I have a workbook that contains data on a different sheet that I would like to populate on a different sheet by selecting a value from a drop down list. The format of the data is identical just different numbers. But are broken out into different projects... I am incredibly new at this and just barely learned how to make a drop down list.
View 7 Replies
View Related
Aug 5, 2014
I am trying to save 'double keying' with a template I use for event RSVP's.
Basically I have one sheet that has a list of invitees for a particular event (can be anything from 5 to 500) along with a bunch of data about them (e.g. address, firm, dietary requirements etc.)
I want to have a SEPARATE sheet that auto-populates its rows with the name and only some of the other data related to each person that accepts the invitation. Sort of like collating the guest list. If at some point they accept and then decline, I need them to be automatically removed (and vice-versa).
I have attached a simplified version of my spreadsheet for reference.
Event Summary Template v1.xlsx‎
View 1 Replies
View Related