Creating a macro that will split data into different worksheets

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
Back
Top