Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, am I supposed to create a variable for the Listbox1.rowsource line?
I still get runtime error. It can't load the listbox. It is just column A, for easy testing I just used the first few rows but I need all last names in the listbox. So are you saying I must load the other two control combox'es the same way? What I did here works except for this list box but are you saying in order to run a procedure based on the choice I need to load them the same as the listbox I will change it but can you tell me why I get the 424 error? Thanks, Private Sub UserForm_Initialize() ComboBox1.AddItem "Print Single" ComboBox1.AddItem "Print Multiple" ComboBox1.AddItem "Exit" ComboBox3.AddItem Date 'ComboBox1.ListIndent = 1 ListBox1.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
no variable needed. post the code your are using. for list box and combo box. Regards FSt1 "Janis" wrote: Sorry, am I supposed to create a variable for the Listbox1.rowsource line? I still get runtime error. It can't load the listbox. It is just column A, for easy testing I just used the first few rows but I need all last names in the listbox. So are you saying I must load the other two control combox'es the same way? What I did here works except for this list box but are you saying in order to run a procedure based on the choice I need to load them the same as the listbox I will change it but can you tell me why I get the 424 error? Thanks, Private Sub UserForm_Initialize() ComboBox1.AddItem "Print Single" ComboBox1.AddItem "Print Multiple" ComboBox1.AddItem "Exit" ComboBox3.AddItem Date 'ComboBox1.ListIndent = 1 ListBox1.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am really sorry but I did post it already, what am I missing? I am just
trying to get it to load the names in column A in the list box, and another combox with the date and another with the choices, multiprint, singlepring or exit. But if you mean the code I want it to run when I click either single or multi print is I want it to take a single name and create a new sheet with that name on it or in the case of a multi-print create new sheets for all the list. This part isn't done yet. "FSt1" wrote: hi no variable needed. post the code your are using. for list box and combo box. Regards FSt1 "Janis" wrote: Sorry, am I supposed to create a variable for the Listbox1.rowsource line? I still get runtime error. It can't load the listbox. It is just column A, for easy testing I just used the first few rows but I need all last names in the listbox. So are you saying I must load the other two control combox'es the same way? What I did here works except for this list box but are you saying in order to run a procedure based on the choice I need to load them the same as the listbox I will change it but can you tell me why I get the 424 error? Thanks, Private Sub UserForm_Initialize() ComboBox1.AddItem "Print Single" ComboBox1.AddItem "Print Multiple" ComboBox1.AddItem "Exit" ComboBox3.AddItem Date 'ComboBox1.ListIndent = 1 ListBox1.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
sorry. i didn't read far enought on your first post. ListBox1.ColumnCount = rng is this how your are trying to load the list box. if so, column count has to be a number. you use this to add multiple columns in the list box. listbox1.rowsource = rng. (i think it will take a named range?) if not then listbox1.rowsource = range("A1:A5") or whatever. you are loading in the initialization sub and you are loading the comboboxes right. regards FSt1 "Janis" wrote: I am really sorry but I did post it already, what am I missing? I am just trying to get it to load the names in column A in the list box, and another combox with the date and another with the choices, multiprint, singlepring or exit. But if you mean the code I want it to run when I click either single or multi print is I want it to take a single name and create a new sheet with that name on it or in the case of a multi-print create new sheets for all the list. This part isn't done yet. "FSt1" wrote: hi no variable needed. post the code your are using. for list box and combo box. Regards FSt1 "Janis" wrote: Sorry, am I supposed to create a variable for the Listbox1.rowsource line? I still get runtime error. It can't load the listbox. It is just column A, for easy testing I just used the first few rows but I need all last names in the listbox. So are you saying I must load the other two control combox'es the same way? What I did here works except for this list box but are you saying in order to run a procedure based on the choice I need to load them the same as the listbox I will change it but can you tell me why I get the 424 error? Thanks, Private Sub UserForm_Initialize() ComboBox1.AddItem "Print Single" ComboBox1.AddItem "Print Multiple" ComboBox1.AddItem "Exit" ComboBox3.AddItem Date 'ComboBox1.ListIndent = 1 ListBox1.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just to make it easier to understand I just tried to load just the one combo
box with the Private Sub UserForm_Initialize() ComboBox2.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub I get the error message runtime 380 cannot load the rowsource? "FSt1" wrote: hi no variable needed. post the code your are using. for list box and combo box. Regards FSt1 "Janis" wrote: Sorry, am I supposed to create a variable for the Listbox1.rowsource line? I still get runtime error. It can't load the listbox. It is just column A, for easy testing I just used the first few rows but I need all last names in the listbox. So are you saying I must load the other two control combox'es the same way? What I did here works except for this list box but are you saying in order to run a procedure based on the choice I need to load them the same as the listbox I will change it but can you tell me why I get the 424 error? Thanks, Private Sub UserForm_Initialize() ComboBox1.AddItem "Print Single" ComboBox1.AddItem "Print Multiple" ComboBox1.AddItem "Exit" ComboBox3.AddItem Date 'ComboBox1.ListIndent = 1 ListBox1.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
perhaps i wasn't clean myself. i ment load the combo boxes in the initialization sub. use the add item method. see my last post. regards FSt1 "Janis" wrote: Just to make it easier to understand I just tried to load just the one combo box with the Private Sub UserForm_Initialize() ComboBox2.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub I get the error message runtime 380 cannot load the rowsource? "FSt1" wrote: hi no variable needed. post the code your are using. for list box and combo box. Regards FSt1 "Janis" wrote: Sorry, am I supposed to create a variable for the Listbox1.rowsource line? I still get runtime error. It can't load the listbox. It is just column A, for easy testing I just used the first few rows but I need all last names in the listbox. So are you saying I must load the other two control combox'es the same way? What I did here works except for this list box but are you saying in order to run a procedure based on the choice I need to load them the same as the listbox I will change it but can you tell me why I get the 424 error? Thanks, Private Sub UserForm_Initialize() ComboBox1.AddItem "Print Single" ComboBox1.AddItem "Print Multiple" ComboBox1.AddItem "Exit" ComboBox3.AddItem Date 'ComboBox1.ListIndent = 1 ListBox1.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Thanks for your help, I'm pretty sure the problem is I don't understand userforms. REgarding the addItem, is that in conjunction with the row source;? Private Sub UserForm_Initialize() ComboBox2.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12") ComboBox2.AddItem End Sub THIS ONE GETS A runtime error type mismatch 13. Regards, "FSt1" wrote: hi, perhaps i wasn't clean myself. i ment load the combo boxes in the initialization sub. use the add item method. see my last post. regards FSt1 "Janis" wrote: Just to make it easier to understand I just tried to load just the one combo box with the Private Sub UserForm_Initialize() ComboBox2.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub I get the error message runtime 380 cannot load the rowsource? "FSt1" wrote: hi no variable needed. post the code your are using. for list box and combo box. Regards FSt1 "Janis" wrote: Sorry, am I supposed to create a variable for the Listbox1.rowsource line? I still get runtime error. It can't load the listbox. It is just column A, for easy testing I just used the first few rows but I need all last names in the listbox. So are you saying I must load the other two control combox'es the same way? What I did here works except for this list box but are you saying in order to run a procedure based on the choice I need to load them the same as the listbox I will change it but can you tell me why I get the 424 error? Thanks, Private Sub UserForm_Initialize() ComboBox1.AddItem "Print Single" ComboBox1.AddItem "Print Multiple" ComboBox1.AddItem "Exit" ComboBox3.AddItem Date 'ComboBox1.ListIndent = 1 ListBox1.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your help, I will just repost the question.
"Janis" wrote: Hi Thanks for your help, I'm pretty sure the problem is I don't understand userforms. REgarding the addItem, is that in conjunction with the row source;? Private Sub UserForm_Initialize() ComboBox2.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12") ComboBox2.AddItem End Sub THIS ONE GETS A runtime error type mismatch 13. Regards, "FSt1" wrote: hi, perhaps i wasn't clean myself. i ment load the combo boxes in the initialization sub. use the add item method. see my last post. regards FSt1 "Janis" wrote: Just to make it easier to understand I just tried to load just the one combo box with the Private Sub UserForm_Initialize() ComboBox2.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub I get the error message runtime 380 cannot load the rowsource? "FSt1" wrote: hi no variable needed. post the code your are using. for list box and combo box. Regards FSt1 "Janis" wrote: Sorry, am I supposed to create a variable for the Listbox1.rowsource line? I still get runtime error. It can't load the listbox. It is just column A, for easy testing I just used the first few rows but I need all last names in the listbox. So are you saying I must load the other two control combox'es the same way? What I did here works except for this list box but are you saying in order to run a procedure based on the choice I need to load them the same as the listbox I will change it but can you tell me why I get the 424 error? Thanks, Private Sub UserForm_Initialize() ComboBox1.AddItem "Print Single" ComboBox1.AddItem "Print Multiple" ComboBox1.AddItem "Exit" ComboBox3.AddItem Date 'ComboBox1.ListIndent = 1 ListBox1.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
This is weird but I tried this and the form at least runs but I still don't get the range in the combo box? Private Sub UserForm_Initialize() ComboBox2.RowSource = rng rng = ThisWorkbook.Sheets("Patients").Range("A1:A12") End Sub tnx, "FSt1" wrote: hi, perhaps i wasn't clean myself. i ment load the combo boxes in the initialization sub. use the add item method. see my last post. regards FSt1 "Janis" wrote: Just to make it easier to understand I just tried to load just the one combo box with the Private Sub UserForm_Initialize() ComboBox2.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub I get the error message runtime 380 cannot load the rowsource? "FSt1" wrote: hi no variable needed. post the code your are using. for list box and combo box. Regards FSt1 "Janis" wrote: Sorry, am I supposed to create a variable for the Listbox1.rowsource line? I still get runtime error. It can't load the listbox. It is just column A, for easy testing I just used the first few rows but I need all last names in the listbox. So are you saying I must load the other two control combox'es the same way? What I did here works except for this list box but are you saying in order to run a procedure based on the choice I need to load them the same as the listbox I will change it but can you tell me why I get the 424 error? Thanks, Private Sub UserForm_Initialize() ComboBox1.AddItem "Print Single" ComboBox1.AddItem "Print Multiple" ComboBox1.AddItem "Exit" ComboBox3.AddItem Date 'ComboBox1.ListIndent = 1 ListBox1.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You have another response at your earlier post.
Janis wrote: Sorry, am I supposed to create a variable for the Listbox1.rowsource line? I still get runtime error. It can't load the listbox. It is just column A, for easy testing I just used the first few rows but I need all last names in the listbox. So are you saying I must load the other two control combox'es the same way? What I did here works except for this list box but are you saying in order to run a procedure based on the choice I need to load them the same as the listbox I will change it but can you tell me why I get the 424 error? Thanks, Private Sub UserForm_Initialize() ComboBox1.AddItem "Print Single" ComboBox1.AddItem "Print Multiple" ComboBox1.AddItem "Exit" ComboBox3.AddItem Date 'ComboBox1.ListIndent = 1 ListBox1.RowSource = ThisWorkbook.Sheets("Patients").Range("A1:A12").Ad dress(external:=True) End Sub -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
runtime error '1004' application or object defined error | Excel Programming | |||
runtime error '1004' application or object defined error. Please help | Excel Programming | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
naming tab macro error runtime error 1004 | Excel Programming | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming |