vba-excel-training - creating new sheets
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training Sitemap add this page to your favourites/bookmarksBookmark page
 
view a printable version of this pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » vba-excel-training - Creating new sheets

vba-excel-training - Creating new sheets

resolvedResolved · Low Priority · Version Standard

replyReplyMon 3 Dec 2007, 16:32Delegate Tom said...

Creating new sheets

Is it possible to have a userform from which more than one value can be picked, and then to create one sheet for every value?

For upcoming training course dates see: Pricing & availability

replyReplyMon 10 Dec 2007, 11:43 Edited on Mon 10 Dec 2007, 11:46Trainer Carlos said...

RE: creating new sheets

Hi Tom

The short answer to this is Yes.

The instructions below use object names I thought up as examples. You can change these names to suit your needs

You need to create a Form "frmNewSheets", with a List Box 'lstSheetNames" and a Button "cmdOK"

In the ListBox properties make sure MultiSelect is on 2 whiuch needs the Shift and Control buttons for multi selection

The in the code area for the m add the following code:

Private Sub cmdOK_Click() 'Takes the names from the list box an creates sheets with the names

Dim i As Integer 'Counts the number of items in the list

For i = 0 To lstSheetNames.ListCount - 1 'The -1 is needed as lists start at 0

If lstSheetNames.Selected(i) = True Then

Sheets.Add After:=Sheets(Sheets.Count) 'Add sheet at end
ActiveSheet.Name = lstSheetNames.List(i) 'Renames the sheet to the selected value

End If

Next i

End Sub
'==========================================
Private Sub UserForm_Initialize() 'Adds the names to the List Box

With Me.lstSheetNames

.AddItem "A"
.AddItem "B"
.AddItem "C"
.AddItem "D"
.AddItem "E"
.AddItem "F"

End With

End Sub


Hope this helps

Carlos

 

 

Excel tip:

Line breaks in a cell

You can control the line breaks for multiple-line headings or labels in your Microsoft Excel worksheet, just like you do in Microsoft Word. Here's how to do it.

Click the cell where you want the label or heading to appear.
Type the first line of information.
Press ALT+ENTER.

View all Excel hints and tips

forum postHow do I insert or delete a macro button from a spreadsheet?

» Forum post: Macro


Rate this page:
2.2/5 (213 votes cast)
Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses
Microsoft Certified Partner
Security Seal verified by visa, mastercard securecard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Management training

Professional Skills courses
Project Management Course London
Project Management Courses London
Project Management Training London
Project Management Training
Project Seminar
Project Seminars
Time Management Course London
Time Management London
Time Management Courses London
Time Management Training London
Introduction to Finance course
Assertiveness Skills course
Effective Communications Skills training
Presentation Skills London

Training Formats

Public scheduled courses
On-site training
Closed company courses

Consultancy
Application Development

Blogs

Excel Training
MS Project Training
Microsoft Training Blog

Version differences

Office 2010 vs 2007
MS Project version differences

Training Information

London Computer Training
Computer Training London
Docklands Training Courses
Docklands Training London

Training venues London
Client list
FAQ
Pricing and availability
Course details / Syllabus

Training Articles
Training Information

Microsoft training

Microsoft Office training
& IT Applications

Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training
MS Project courses
MS Project training
Outlook courses
PowerPoint courses
PowerPoint training
VBA courses
Word courses
Microsoft.training
(more...)

Excel Training

Excel courses
Excel Training Courses Medway
Autonumber in Excel
Microsoft Excel training
Basic Excel Courses
Basic Excel Course
Basic Excel Training

Interested in MS Access training?

Access courses
Microsoft Access training
Microsoft access courses
Microsoft training access course
Microsoft+access+training
Access courses in london

Training provider

Training providers
IT training companies
IT training providers
Management Training providers
Management Training provider

Event history, feedback results
Events in 2012 · 2011 · 2010 · More

See also

Crystal Reports training