Creating a macro that will split data into different worksheets

G

Guest

I would like to create a macro that will automatically create a worksheet
based on name. For example, if I have a file of sales data by salesrep, how
can I create an individual worksheet for each sales rep without copying and
pasting the data? Thanks.
 
D

Don Guillett

Sub addshets()
For Each c In Range("a2:a5")
On Error Resume Next
Sheets.Add after:=Sheets(Sheets.Count): ActiveSheet.Name = c
Next c
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top