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