Creating Tabs from a ComboBox in a form

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
On a tab I have a list of Customers along with their ID. I also have a Template where the user will input information about some of the customers.

Right now the user goes to the user Template and copies it and then in a list on that tab selects the customer and then starts entering data.

I was thinking of having a Form pop up where it shows all the customers and their ID in a list/combo Box. When the user triggers the Userform they can go through the list and make selections of which customers they need to enter data for. From that multi selection they click a button on the form and a copy of the Template is duplicated/copied for each customer selected in the list.

So if the user selects Smith, Jones and Brown out of the list of 100 customers, the code will make 3 copies of the template.

(I will rename each tab as they are made)

My question is; is what I want to do possible? Is there a way to know how many selections where made in the list-box by the user?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
You can do it with a multiselect listbox, like
Code:
Private Sub CommandButton1_Click()
Dim i As Long
With Me.ListBox1
   For i = 0 To .ListCount - 1
      If .Selected(i) Then
         Sheets("new").Copy , Sheets(Sheets.Count)
         ActiveSheet.Name = .List(i)
      End If
   Next i
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top