View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
isabelle isabelle is offline
external usenet poster
 
Posts: 587
Default Adding Worksheets to a Workbook using a MultiSelect List Box

hi,

i suppose that the ListBox have a single column
otherwise
for example, to retrieve the value of the 3rd column of a Listbox
ListBox1.List(i, 2)

For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
On Error Resume Next
Sheets(ListBox1.List(i)).Select
If Err.Number < 0 Then
Err.Clear
Sheets.Add(After:=Sheets(Sheets.Count)).Name = ListBox1.List(i)
Else
MsgBox " This sheet <" & ListBox1.List(i) & " already exist"
End If
End If
Next i

isabelle

Le 2014-05-21 12:35, wkwells a écrit :
I have a workbook that I want to be able to add worksheets to it by checking selections in a MultiSelect Listbox,
and I want the Tab Name to be the same as the Name selected in the MultiSelect Listbox.
I am stumped, I figured how to print sheets from a MultiSelect Box and even delete worksheets, but adding them has my puzzled.

Thank you in advance for any help.

WKWells