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

resolvedResolved · Low Priority · Version 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:

Adjusting the Elevation and Rotation in a 3-D Chart

For any 3-D chart you create, you can adjust the chart

View all Excel hints and tips


Server loaded in 0.07 secs.