![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Location: NSW. Australia
Posts: 64
|
Does anyone know how to get a combo box to look up values in a certain sheet.
I have tried the following code: Private Sub UserForm_Initialize() rownumber = [A65536].End(xlUp).Row rownumber = rownumber + 1 Dim wscell As Range For Each wscell In Range("Client Details!A1:A25") cboDetails.AddItem (wscell.Value) Next txtDate.SetFocus End Sub The sheet name is the Client Details. When I remove this reference the combobox works fine. Thanks in advance |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Posts: 124
|
How about just:
cboDetails.ListFillRange = "Client Details!A1:A25" |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Posts: 64
|
It may not work due to lack of single quotes around your spreadsheet name. This is necessary when you have a space in the name. Try:
For Each wscell In Range("'Client Details'!A1:A25") That is a double quote, then single quote, then Client Details, then single quote and etc [ This Message was edited by: Fryer Tuck on 2002-05-06 11:15 ] [ This Message was edited by: Fryer Tuck on 2002-05-06 11:16 ] [ This Message was edited by: Fryer Tuck on 2002-05-06 11:18 ] |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Apr 2002
Location: NSW. Australia
Posts: 64
|
Thanks Fryer Tuck. Once I added the extra quote the problem was solved.
Cpod I could not get your code to work. But thanks anyway |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|