Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Adding Worksheets to a Workbook using a MultiSelect List Box

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

--
Posted by Mimo Usenet Browser v0.2.5
http://www.mimousenet.com/mimo/post


  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Adding Worksheets to a Workbook using a MultiSelect List Box

Perfect thank you much

On 23 May 2014 11:21 PM ,isabelle wrote:
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



--
Posted by Mimo Usenet Browser v0.2.5
http://www.mimousenet.com/mimo/post


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
Adding over 30 worksheets in a workbook -E New Users to Excel 4 December 30th 08 06:11 PM
Need help with MultiSelect List Box Mulberry[_2_] Excel Programming 7 October 25th 06 04:46 PM
Multiselect List Box Bill[_30_] Excel Programming 1 February 23rd 06 05:00 PM
List Box - MultiSelect Bill[_28_] Excel Programming 2 January 31st 05 10:31 PM
Multiselect list box ptaylor[_2_] Excel Programming 5 January 28th 05 05:35 PM


All times are GMT +1. The time now is 04:28 AM.

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"