View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Creating a macro that will split data into different worksheets

Sub addshets()
For Each c In Range("a2:a5")
On Error Resume Next


Sheets.("Template").copy after:=Sheets(Sheets.Count): ActiveSheet.Name = c


Sheets.Add after:=Sheets(Sheets.Count): ActiveSheet.Name = c
Next c
End Sub



--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
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

--
Don Guillett
SalesAid Software

"Bob" wrote in message
...
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.
--
Bob