ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Creating a macro that will split data into different worksheets (https://www.excelbanter.com/excel-discussion-misc-queries/135219-creating-macro-will-split-data-into-different-worksheets.html)

Bob

Creating a macro that will split data into different worksheets
 
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

Ron de Bruin

Creating a macro that will split data into different worksheets
 
See this page Bob
http://www.rondebruin.nl/copy5.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"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


Don Guillett

Creating a macro that will split data into different worksheets
 
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




Don Guillett

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







All times are GMT +1. The time now is 08:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com