Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Which control to use in a UserForm?"
This is my first shot at this task so be patient, please...:)
I would like to develop a UserForm2 that can be called from an option button on another UserForm1. UF1 is already done and works fine. On UF2 would be either a ComboBox or a ListBox, or whatever might be appropriate to get the following job done. I have a list of names on Sheet1 in ColA. This list would be loaded into the ?box so that the OP could scroll to and highlight a name for an action. Then code assigned to an "OK" button would do the following: Determine the Row the name is in, Select that entire Row and ClearContents (not Delete) of same. Delete introduces errors on other Sheets in the WB. I'm also having a bit of trouble loading Col A into a ListBox or ComboBox. (this has to be done everytime UF2 is called as the list does change from time to time) If it matters, I already have a macro that will be called that sorts Sheet1 using Col A for the sort so there are no empty Rows in Col A, prior to calling UF2. Any help would be greatly appreciated. TIA.... Don |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Which control to use in a UserForm?"
"Don" wrote in message ... This is my first shot at this task so be patient, please...:) I would like to develop a UserForm2 that can be called from an option button on another UserForm1. UF1 is already done and works fine. On UF2 would be either a ComboBox or a ListBox, or whatever might be appropriate to get the following job done. I have a list of names on Sheet1 in ColA. This list would be loaded into the ?box so that the OP could scroll to and highlight a name for an action. Combobox sounds right Then code assigned to an "OK" button would do the following: Determine the Row the name is in, Select that entire Row and ClearContents (not Delete) of same. Delete introduces errors on other Sheets in the WB. iRow = Application.Match(ComboBox1.Value, Worksheets("Sheet1").Columns(1),0) If iRow 0 Then Rows(i).ClearContents End If I'm also having a bit of trouble loading Col A into a ListBox or ComboBox. (this has to be done everytime UF2 is called as the list does change from time to time) If it matters, I already have a macro that will be called that sorts Sheet1 using Col A for the sort so there are no empty Rows in Col A, prior to calling UF2. With Worksheets("Sheet1"). iLastRow = .Cells(.Rows.Count,"A").End(xlUp).Row For i = 1 To iLastRow CombobBox1.AddItem .Cells(i,"A").Value Next i End With |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Which control to use in a UserForm?"
Thanks for the very quick reply Bob....I'll see if I can make it work and
post later the results.....Tks again... Don "Bob Phillips" wrote: "Don" wrote in message ... This is my first shot at this task so be patient, please...:) I would like to develop a UserForm2 that can be called from an option button on another UserForm1. UF1 is already done and works fine. On UF2 would be either a ComboBox or a ListBox, or whatever might be appropriate to get the following job done. I have a list of names on Sheet1 in ColA. This list would be loaded into the ?box so that the OP could scroll to and highlight a name for an action. Combobox sounds right Then code assigned to an "OK" button would do the following: Determine the Row the name is in, Select that entire Row and ClearContents (not Delete) of same. Delete introduces errors on other Sheets in the WB. iRow = Application.Match(ComboBox1.Value, Worksheets("Sheet1").Columns(1),0) If iRow 0 Then Rows(i).ClearContents End If I'm also having a bit of trouble loading Col A into a ListBox or ComboBox. (this has to be done everytime UF2 is called as the list does change from time to time) If it matters, I already have a macro that will be called that sorts Sheet1 using Col A for the sort so there are no empty Rows in Col A, prior to calling UF2. With Worksheets("Sheet1"). iLastRow = .Cells(.Rows.Count,"A").End(xlUp).Row For i = 1 To iLastRow CombobBox1.AddItem .Cells(i,"A").Value Next i End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to have a macro simply issue the "find" command or "control f: | Excel Programming | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
"Control" plus "click" doesn't allow me to select multiple cells | New Users to Excel | |||
Scroll Bar missing "Control" tab in "Format Properties" dialog box | Excel Discussion (Misc queries) | |||
Error "Permission denied" when printing Web Browser control from button on userform, | Excel Programming |