Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Multi Select List Box

I have a user form containing a multi select list box
based on names of worksheets in a workbook (but not all of
them mind). I have written the code when I need to work
on all of the selected worksheets at once, ie
ThisWorkbook.Sheets(aSheets).Select
However what would be the correct syntax (I'm guessing at
For Each), to select the chosen sheets one at a time, then
loop to the next one. You've probably guessed that
there's some stuff going on in between the loop but I'm ok
with the VBA for that.

I've tried
For Each Worksheets.(asheets) in This Workbook but excel
didn't like that. It's pitiful I know, so pls don't laugh.

Any help is appreciated
Thanks, Jacqui

FYI
The code is as follow
Dim i As Integer
Dim aSheets() As String
Dim lListItem As Long
Dim lIndex As Long

lIndex = -1

Application.ScreenUpdating = False


For lListItem = 0 To LstSheet.ListCount - 1
If LstSheet.Selected(lListItem) Then
lIndex = lIndex + 1
ReDim Preserve aSheets(0 To lIndex)
aSheets(lIndex) = LstSheet.List(lListItem)
End If
Next lListItem

there's lots of other code in here but I won't bore you
with that

ElseIf OptPrint.Value = True And lIndex -1 Then

Set_Print_Areas

this is where I need some help!





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
Multi-select from a dropdown list PaulaG Excel Discussion (Misc queries) 5 April 7th 10 06:52 PM
Multi Select from Drop List PatriciaT Excel Discussion (Misc queries) 2 September 8th 09 06:33 PM
List Box - Multi Select Issue Joe Wildman[_2_] Excel Worksheet Functions 2 February 6th 09 12:00 AM
how do I select multi values from a list Tommy Excel Discussion (Misc queries) 1 July 12th 06 09:38 AM
List Box Multi Select Option ann_nyc Excel Worksheet Functions 0 October 11th 05 05:56 PM


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

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

About Us

"It's about Microsoft Excel"