Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Depending on what you mean by dynamic range, you may want to use something like:
With ThisWorkbook.Worksheets("Sheet 1") Set myRng = .Range("a1:e" & .Cells(.Rows.Count, "A").End(xlUp).Row) End With But I'm repeating myself. Office_Novice wrote: Not to come across as ungreatful, I think y'all are great. I couldnt get your suggestion to work in my application. I have the ability to add to th combo box via user input box in vba thus wanting a dynamic range. But i do appreciate your time. Thanks again. "Dave Peterson" wrote: I don't see how either of these are dynamic. And I'd bet that you mistyped one of the worksheet names. But that's a guess. I guess you really didn't want the suggestion I made, huh? Office_Novice wrote: Private Sub UserForm_Initialize() PayCB.RowSource = "Payee!A2:A456" CreditCB.RowSource = "Credit!A2:A456" End Sub I can get one of these to work. But not both any ideas "Dave Peterson" wrote: What did you use in code? What did you type into that rowsource manually? Office_Novice wrote: WorkSheet Name = Cash Range = The range is dynamic but it is in column A Nothing happens "Dave Peterson" wrote: I don't know. What is the name of the worksheet that holds the data? What is the address of the range that holds the data? What happens when you tried each of them? Office_Novice wrote: I Cant Get either of these to work. What am i doing wrong? "Dave Peterson" wrote: You could use code: Option Explicit Private Sub UserForm_Initialize() Dim myRng As Range With ThisWorkbook.Worksheets("Sheet 1") Set myRng = .Range("a1:e" & .Cells(.Rows.Count, "A").End(xlUp).Row) End With With Me.ComboBox1 .ColumnCount = myRng.Columns.Count .RowSource = myRng.Address(external:=True) End With End Sub Or you could just type the address into the combobox's rowsource property: 'sheet 1'!a1:E99 Office_Novice wrote: I have a pair of comboboxes that i would like to fill using Rowsource. I need the source of each to be on different sheets that are hidden. I have about given up. Any help woul be great. -- Dave Peterson -- Dave Peterson -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ComboBox on a UserForm | Excel Worksheet Functions | |||
UserForm ComboBox | Excel Programming | |||
Combobox userform help please | Excel Programming | |||
combobox and userform help! | Excel Programming | |||
Userform w/ComboBox | Excel Discussion (Misc queries) |