Workbook Open Populate Combobox?
Apr 3, 2012
Ive got 12 sheets, one for each month, and I've got a combobox in each sheet, and Ive got a macro for each combobox, that makes it jump to the correct sheet number. The problem is that when I try to populate the comboboxes under the workbook_open() sub, it doesnt work.
Tried
Code:
Private Sub workbook_open()
ComboMaaned.List = Array("Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", _
"September", "Oktober", "November", "Desember")
End Sub
tried with
Code:
Sheets("Sheet1").select
and
Code:
Sheets("Sheet1").ComboMaaned.list = Array ...
Seems to crash every time.
View 9 Replies
ADVERTISEMENT
Mar 17, 2014
I need to populate combo boxes from a list of data on a separate workbook. I set everything up then found out the way I did it the seperate workbook must be opened before the drop downs are populated with the information. Is there a way to not have the linked workbook open?
Also these workbooks are all contained in their own file that must be duplicated on to other machines and into other larger files. I need that linked information to always follow the workbook contained in the same file. Another words if I have the original file "A" and duplicate it and now have a file "B" I want the combo box in file B to be linked to the workbook in file B.
View 2 Replies
View Related
Jul 28, 2012
I am looking to fill out a combobox (say combobox1) in a userform from a set of ranges located in a different workbook (that is in a different location).
For example, the cells that would need to be in the combobox are B5:B41,D5:D40 and F5:F45 and the file location is W:WCWORKCENTERS.xls
View 3 Replies
View Related
Mar 27, 2014
I'm trying to link combo box's on a user form to a hidden workbook. I placed the workbook into
C:Users[User Name]AppDataRoamingMicrosoftExcelXLSTART
Then hide the worksheet which essentially hides the workbook as only 1 sheet is present in workbook. This should make the workbook available every time a user opens Excel
Now when i initialize the form i get an error
Run-time error '1004': Method 'Range' of object'_Global failed
However when i unhide the worksheet the form runs fine. Do i need to declare the combo boxes differently than shown below The range "Tools" does exist on the hidden workbook.
View 10 Replies
View Related
Feb 11, 2013
Using the developer tab I inserted an Active X combo box. Under properties I referenced a 'linked cell' that I want the data to appear in. This box works great as long as I keep the sheet open. Once I save and close the workbook and re-open, that reference is lost. It shows #REF! in that field. Why does it lose the reference? I have tried to reference a cell on the same sheet as well as a cell in a different sheet and it keeps the sheet name but not the individual cell.
View 13 Replies
View Related
Mar 30, 2014
I need to populate two combo boxes from excel sheet, the data will be like below:
Column A Column B
A 1
A 2
A 3
A 4
A 5
B 100
B 101
B 102
So from the above data, one combo box should hold unique values A & B.
On selecting a value from the 1st combo box A or B, respective values should be populated in 2nd combo box.
So the data should be like below:
If A is selected in the 1st combo box, then 2nd combo box should only show the values 1,2,3,4 & 5.
If B is selected in the 1st combo box, then 2nd combo box should only show the values 100,101 & 102.
Friends I need it in a macro and one important point is, this is dynamic and it is not static and the data can be more.
View 1 Replies
View Related
Jun 12, 2006
I have a table, headers "FirstName" and "SurName".
Further a Userform with 2 Comboboxes "FirstName" and "SurName"
I'd like to choose the FirstName (say Jack) in the "FirstName" combobox, and based on that get the choice of the Surnames of all my Jacks in the "SurName" combobox.
Actually my sheet has much more fields and comboboxes, but i think my problem is just that I do not find a way to populate them dynamically.
View 9 Replies
View Related
Apr 6, 2013
I have created a spreadsheet some time ago and have been asked to improve on it but I'm rusty with VBA.
I have an automated ordering system that saves each sent order as the date e.g "05-04-2013.xls" but the management team want a graph with the data for the last 4 weeks compared. I have created a seperate workbook called "consumables report.xls" which has a column with the products listed followed by columns "Quantity" and "cost" which is repeated for the 4 weeks of the month.
I want to add a button to prompt the user to choose the saved order e.g "05-04-2013.xls" (all orders saved in same directory) to copy and paste the quantity and cost columns (c8,D69) into "consumables report.xls". I got this to work earlier but it would only paste the formulas and not the values. So I need
A prompt to open workbook
Copy range (c8,d69)
Close work sheet
Paste special .value (c8,D69)
I dont care if it has to open the workbook to copy the data as this will only be used once a month so it dosnt matter how slow the code is.
week 1 week 2 week 3 week 4
Product
quantity
cost
quantity
cost
cost
quantity
cost
1
2
3
4
5
6
7
8
View 7 Replies
View Related
Jul 8, 2006
I have Monthly sales sheets that import my cash register data into them. I wanted to set them up to do everything without being there. So I have my task manager open excel at 9:30pm everyday and it runs the macro to import the data into the correct day of the month. Here is the workbook
open macro-
Private Sub Workbook_Open()
Dim dTime As Date
dTime = Time
If dTime >= TimeValue("9:30 PM") And _
dTime < TimeValue("9:40 PM") Then
ImportData
End If
End Sub
This is in my July spreadsheet only. So is there a way to make it know which month spreadsheet to open on the 1st of the month? So come August 1st it will automatically open the August workbook and input the data for the first day? By using the date?
View 9 Replies
View Related
Oct 22, 2007
I want it to populate a combobox in a userform. Should it go in the code segment for the userform, in a module, or some other place? The following is code I originally found (by Leith Ross of this board) to find the last row in column "A", and load the combo box "ComboBox1"
View 3 Replies
View Related
Jan 26, 2009
able to populate a combobox from data elsewhere in the workbook as follows:
View 7 Replies
View Related
Jul 3, 2009
It's a customer form where I need the contact person (txtContact) to be filled out when selecting the customer (in the cboCustomer).
The data is listed on the sheet "Customer", where all the customer names are in column from B2. The contact names are from C2 in the same sheet.
I have made a list in the namemanager called Contactlist (=OFFSET(Customer!$C$2;0;0;COUNTA(Customer!$C:$C)-1;1)
I have this VBA for getting the customer to the cbobox
View 9 Replies
View Related
Jan 15, 2013
I have created a combobox1 and I have written a code to populate the box the problem is when I run the form and select the data from the dropdown list it gives me an error. I can see the data but just can't select it. I have a command button that I use to save the data I select and insert it into fields on my worksheet. All I just need the drop down box to let me select the data I chose below is my code.
Private Sub ComboBox1_Click()
ComboBox1.Value = .Range("A2:A14")
End Sub
View 2 Replies
View Related
Jun 27, 2014
i would like to create a vba that will populate based on the comboboxes value
like this code
Code:
'for cmb1
'if cmb1 = major 1 then
'if range"F4" is empty then
'copy sheet1 range"A5:R5" to sheet2 range"F4"
'if cmb1 = major 2 then
'if range"F4" is empty then
'copy sheet1 range"A16:R16" to sheet2 range"F4"
[code]....
View 1 Replies
View Related
Dec 29, 2008
i have the following
Dim cn As ADODB.Connection
Dim qc As ADODB.Recordset
Dim Equip_File As String
Dim Equip_ID As String
Dim Equip_Param As String
Set cn = New ADODB.Connection
Set qc = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\ServerDISK 1UncertaintiesUncertainties.mdb"
'Populate QC Number Dropdown menu
qc.Open "SELECT [Equipment_QC] FROM [Equipment_Table]", cn, adOpenStatic
With ComboBox12.List
.Clear
Do Until qc.EOF
.AddItem
qc.MoveNext
Loop
End With
Equipment_Title.Text = rst.Fields.Item("Equipment_Title").value
qc.Close
however, i cant seem to populate the list, i get error :424 object required
is this because the first record in the db has the Equipment_QC field blank? i need to be able to have blank fields..
View 9 Replies
View Related
May 17, 2006
I'm looking to change the value of a variable using the selected value of a combobox. I've used the following
Dim DatabaseVal As String
'then on selecting my option from the combo box: "JVU" or "VPU" are the only two options.
DatabaseVal = cmbDbase.Value
When I try and use the variable 'DatabaseVal' to populate a value in another workbook (the workbook contains a reference to the add-in running the above macro), the cell just gets populated with a blank value. I'm sure I'm doing something stupid, but can't see what.
View 3 Replies
View Related
Dec 1, 2006
I am trying to populate a combo box with two columns of data read from two consecutive (or non consecutive) columns of data. The following code is what I have come up with after visiting several of the previous threads on similar topics (couldn't find one that gave a general, concise solution).
Private Sub UserForm_Initialize()
Dim lngRow As Long
Dim lngRowtot As Integer
Parameters1.SG1.Clear 'Clear combobox SG1 in userform named Parameters1
'Find the number of rows required for the array and combo box
lngRow = 12 'Start searching on row 12
Do While Sheets("Timber Properties").Range("H" & lngRow).Value <> "" 'Read until empty col H lngRowtot = lngRow - 11
lngRow = lngRow + 1
Loop
Dim MyArray(1 To lngRowtot, 1 To lngRowtot) As String 'I get an error with the last ingRowtot on this line.....................
View 2 Replies
View Related
Nov 7, 2012
I have a VBA form and on form initialize I want to populate a combo box… My array to populate it with could be a massive list so I need to set my array before it populates
I have this code so far but I need my array to be from A5 to the last row in sheet 1
I know how to set an exact range but not one that changes.
VB:
Dim myArray As Variant
myArray =
With Me.ComboBox1
.List = myArray
End With
Here is a sample of the data I need to populate in the combobox.
client_ref
A0008
A024
AA005
AA009
[Code] ....
View 8 Replies
View Related
Feb 22, 2008
I have a userform (uf_PaxInput) with a Combobox (cmb_flight_dest) which I am trying to populate from a worksheet range ("Dest") using the following code:
VB:
Sub LoadForm()
With uf_PaxInput.cmb_flight_dest
For Each Item In Range("Dest")
.AddItem
Next Item
End With
uf_PaxInput.Show
End Sub
The code seems to run okay however whent the form loads the combobox drops down to show only blank items to select. These blank items number them same number of items that are in my named range ("Dest").
View 6 Replies
View Related
Aug 5, 2014
I am looking for a way to have 1 combo box, but be able to click on any cell in a range and yield an individual results. In this particular case I am tracking maintenance, and what my crew's corrective actions were for each location. As this varies day by day I cannot use HLookup or VLookup. Also, the lists vary, and have over 100 options.
What I would like is to be able to click in the cell, and instead of scrolling through a list of 109 options be able to start typing the action and it to auto populate. This gets tedious when there are often 50+ locations with maintenance calls per night.
Furthermore, keeping the results exact for VLookup that is being used on another sheet.
I've attached a blank sheet. Columns B, E, F, & H each would ideally have their own combo box. I could click on any cell in the column and when I begin typing the option it would autofill to the correct list item.
Their respective List are currently to the right under columns J, L, N, & P with their headers matching the exact name they've been given.
View 2 Replies
View Related
Aug 15, 2007
All I want to do is
put a combo box on a spreadsheet,
have it populated, and sorted - ideally, alphabetically with range names already created.
And
I'd like to be able to click on the Range Name and GoTo the location.
View 9 Replies
View Related
Jun 10, 2008
I have successfully used the course booking form as a base for an input form in an accounting workbook that has several pages. (Thanks to Roy and others for the info; the course booking form on [url]is the best explained piece I have found on the net)
What I would like to do is use a range of cells to populate the combobox so that a user can make a choice from the account descriptions (from a sheet named Intro, b63:99) and have the form return the account number (Intro, a63:a99) to the relevant cell elsewhere in the workbook. The user would then have meaningful descriptions rather than numbers to choose from.
My coding for the form thus far is as follows.
View 10 Replies
View Related
Mar 28, 2009
I need to link the textboxes of a form to the appropriate cells associated to the selection made by a combobox. And in the process I need to be able to Edit one of those Textboxes on the fly while the rest will be locked to the user.
Not sure if the editing of the Notes section can be real time of if it must be updated through a button.
View 10 Replies
View Related
Nov 22, 2013
How do we populate a List Box based on two Combo Box Selection on a userform?
Sheet2 has 5 Columns of datas all the way down...
Combobox1 is the Column A
Combobox2 is the Column B
View 3 Replies
View Related
Apr 22, 2014
I am trying to populate (via VBA) a textbox/combo box from one user form to another user form.
The first user form has a room number in a text box1. If certain conditions exists, a button is selected to bring up another user form (both forms are modeless).
I want to pass/populate some of the 1st user Form info into the other user form.
I have tried the on initialize textbox1.value = textbox other.value but no dice. I can populate a user form text box from a spreadsheet but from box to box in separate user forms has me a little stumped.
View 3 Replies
View Related
Jul 5, 2014
I want to create a userform that selects a Staff members name from a combo box, once selected the listbox would then display what time off that person has taken - ultimately I would then like to be able to select a date taken and either edit or delete it from the sheet that holds the information.
View 7 Replies
View Related
Jun 10, 2006
I have a userform with a combobox and a textbox, I would like that when I click the dropdown on the combobox I can pick an item from a list found on a spreadsheet in column A. This spreadsheet has two columns of data A & B. I would like to automatically populate the textbox with the data (from Column B) based on what was chosen in the combobox for (column A).
Example
A B
Don $5.00
John $6.75
Jerry $4.75
If I was to pick John in the combobox, I would like for the textbox to populate with $6.75.
View 9 Replies
View Related
Jul 5, 2006
I have a userform that contains 5 combobox. The userform will be initilized on sheet1 and the data is on sheet3 in the following columns:
Combobox1 = sheet3 ("A3:A6000")
Combobox2 = sheet3 ("B3:B6000")
Combobox3 = Sheet3 ("C3:C6000")
Combobox4 = sheet3 ("D3:D6000")
Combobox5 = sheet3 ("E3:E6000")
Combobox6 = sheet3 ("F3:F6000")
When the userform is loaded, I want the data in each range to be available in the dropdown for each respective combobox. It would be great if spaces can be removed from each list, but from what I read, this may be an issue.
View 9 Replies
View Related
Nov 21, 2006
How I can refer to sheet...Without activating sheet. i have this
Private Sub carga_click()
Sheets("Codigos de Area").Select
Sheets("Codigos de Area"). Cells(1, 2).Select
While ActiveCell <> ""
ActiveCell.Offset(1, 0).Select
ComboBox1.AddItem ActiveCell
Wend
End Sub
View 2 Replies
View Related
Jan 9, 2007
I use
Set rnData = ActiveSheet. Range("ProductList")
vaData = rnData.Value
With Me.model
.Clear
.List = vaData
.ListIndex = -1
End With
to populate a combobox list. 'ProductList' is a Dynamic Named Range with the definition
=OFFSET(Stock_List!$L$2,0,0, COUNTA(Stock_List!$L:$L)-1,1)
The '-1' allows for a heading at the top of the column.
This works fine when the list in col. L has more than one entry under the heading. But with only one entry I get 'Runtime error 381 - Could not set the List property, Invalid property array index' and the debug highlights on
.list=vaData
View 9 Replies
View Related