Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default can a User Form reference several sheets?

I need to write a User Form that has several combo boxes/list boxes whose
values are located on another spreadsheet. How do I reference the ranges from
those other sheets?

I have a sheet named "Dashboard" that contains the User Form. The data that
populates the controls on the form is located in the sheet named "Lists".

Any help would be appreciated.

Adam
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default can a User Form reference several sheets?

Here's one way you can try. This assumes combobox1 and your list is in A1 to
A15 on the "Lists" sheet.

UserForm_Initialize
Dim myrange As Range
Set myrange = Sheets("Lists").Range("A1:A15")

Dim cell as variant
For Each cell in myrange
If IsEmpty(cell) Then 'skip the cell if it is empty
Else
combobox1.AddItem cell
End if
Next cell

End sub

Hope it helps.
Dave

"Adrockvt" wrote:

I need to write a User Form that has several combo boxes/list boxes whose
values are located on another spreadsheet. How do I reference the ranges from
those other sheets?

I have a sheet named "Dashboard" that contains the User Form. The data that
populates the controls on the form is located in the sheet named "Lists".

Any help would be appreciated.

Adam

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Minimum and maximum value of Axis set by user by reference to form jonny Charts and Charting in Excel 1 June 22nd 07 06:30 PM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM
copy sheets selected on user form Tom Ogilvy Excel Programming 0 August 19th 04 06:15 PM
copy sheets selected on user form Ron de Bruin Excel Programming 0 August 19th 04 06:03 PM


All times are GMT +1. The time now is 12:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"