vba create multiple
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of 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 - Create Multiple Sheets with different strName

VBA - Create Multiple Sheets with different strName

resolvedResolved · Low Priority · Version 2003

replyReply Mon 2 Aug 2010, 11:15Delegate Andy said...

Andy has attended:
No courses

VBA - Create Multiple Sheets with different strName

Hi There

I am trying to apply the example worked through in training into our live environment.

I regularly have to split out seperate data from a central worksheet into multiple sheets based on the directorates within our trust (there are 27 different directorates).

Is there a way to automate the selection of strName based on a list that will then create a new sheet for each strName rather than to have to select each new strName individually/manually?(i.e. in the training example, to automatically create a new sheet/report for each salesperson)

Many Thanks

Andy

For upcoming training course dates see: Pricing & availability

replyReply Mon 2 Aug 2010, 13:34Trainer Stephen said...

RE: VBA - Create Multiple Sheets with different strName

Hi andy

Thanks for your question

Create a procedure that loops through the list of names on the list page one at a time. It then sets the current name equal to strname and then calls the main report

So

For i = 1 to sheets("List Page").range("a1").currentregion.Rows.Count

strname = sheets("ListPage").cells(i,1).value
call mainspreport

Next i


Hope this helps

Stephen

 

Please browse our web site to find out more about
basic excel training and other Microsoft training courses.

Excel tip:

Selecting blank cells within a range of data

Select the range of data which includes the blank cells that you would like to select. Press the F5 key, this will take you to the GoTo dialogue box where you can click on Special and then select Blanks.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard