Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

vba create multiple

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

ResolvedVersion 2003

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

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

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Auto-insert the current time

In Microsoft Excel, to enter the current time into a cell, hold CTRL+SHIFT and press SEMICOLON.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.