#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Populating listbox

Hi

Have a range of sheets:

12May
19May etc

In a userform I grab the correct sheet using:

Dim grabdate As String
'a drop down with names of the sheets
grabdate = cboE2WeekBeg.Value
Sheets(grabdate).Select

All works fine.

I then want a listbox to display a set range of cells but from the
selected worksheet.

Have tried
lstE2WeekSelected.RowSource = ActiveSheet.Range("a3:j26")

and

sheets(grabdate!a3:j26)

but both throw errors.

Any help appreciated

Mick
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Populating listbox

I'd try:

lstE2WeekSelected.RowSource =
ActiveSheet.Range("a3:j26").address(external:=true )

or dropping the .select stuff

lstE2WeekSelected.RowSource _
= Sheets(grabdate).Range("a3:j26").address(external: =true)



Mick wrote:

Hi

Have a range of sheets:

12May
19May etc

In a userform I grab the correct sheet using:

Dim grabdate As String
'a drop down with names of the sheets
grabdate = cboE2WeekBeg.Value
Sheets(grabdate).Select

All works fine.

I then want a listbox to display a set range of cells but from the
selected worksheet.

Have tried
lstE2WeekSelected.RowSource = ActiveSheet.Range("a3:j26")

and

sheets(grabdate!a3:j26)

but both throw errors.

Any help appreciated

Mick


--

Dave Peterson
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
Listbox 2 takes the value of Listbox 1 Illya Teideman Excel Discussion (Misc queries) 3 April 10th 07 03:20 PM
listbox B conditional of input in Listbox A Kim K Excel Discussion (Misc queries) 1 October 31st 06 08:27 PM
Listbox B if LIstbox A equals Kim K Excel Discussion (Misc queries) 2 October 31st 06 07:03 PM
Populating another tab. Brian Excel Discussion (Misc queries) 1 June 24th 05 12:29 AM
Listbox Greg Brow New Users to Excel 2 February 18th 05 09:36 AM


All times are GMT +1. The time now is 12:42 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"