Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Subject: Macro- Copy same rows into own worksheets

I need a macro or VBA to Copy Same Rows Data in A:A into their own
Worksheets with the same row name.

From a list in column A in sheet1 that has the multiple rows of same name
and I want to creates a worksheets named by that row name. Names are always
A,B,C



Example:
Worksheet SHEET1

a

a

a

b

b

b

c

c

c


(save worksheet: sheet1)



Worksheet: a Worksheet: b Worksheet: c

a b c

a b c

a b c




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Subject: Macro- Copy same rows into own worksheets

Hi LesleyC

See this page for example code
http://www.rondebruin.nl/copy5.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"LesleyC" wrote in message ...
I need a macro or VBA to Copy Same Rows Data in A:A into their own Worksheets with the same row name.

From a list in column A in sheet1 that has the multiple rows of same name and I want to creates a worksheets named by that row
name. Names are always A,B,C



Example:
Worksheet SHEET1

a

a

a

b

b

b

c

c

c


(save worksheet: sheet1)



Worksheet: a Worksheet: b Worksheet: c

a b c

a b c

a b c






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Subject: Macro- Copy same rows into own worksheets


"LesleyC" wrote in message
...
I need a macro or VBA to Copy Same Rows Data in A:A into their own
Worksheets with the same row name.

From a list in column A in sheet1 that has the multiple rows of same name
and I want to creates a worksheets named by that row name. Names are

always
A,B,C

<snip example layout

'copy raw invoice data to working tab and add a sheet for each row name
Sheets("Sheet1").Copy After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = "Data"
Sheets.Add.Name = "A"
Sheets.Add.Name = "B"
Sheets.Add.Name = "C"
'copy title row to new sheets
For Each WS In Worksheets(Array("A", "B", "C"))
WS.Range("A1:G1").Value = Sheets("Data").Range("A1:G1").Value 'adjust range
for your title row
Next
'seperate data to corresponding sheet
Sheets("Data").Activate
For Each cell In Range("A1:A" & Range("A65536").End(xlUp).Row) 'loop thru
cells w/data
Select Case cell.Value
Case "A": cell.EntireRow.Cut
Sheets("A").Range("A65536").End(xlUp).Offset(1, 0)
Case "B": cell.EntireRow.Cut
Sheets("B").Range("A65536").End(xlUp).Offset(1, 0)
Case "C": cell.EntireRow.Cut
Sheets("C").Range("A65536").End(xlUp).Offset(1, 0)
End Select
Next
'optionally remove sheets("Data") without bothering user since its now empty
Application.DisplayAlerts = False
Sheets("Data").Delete
Application.DisplayAlerts = True
end sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Rows with a cell value 0 from several worksheets to a new sh Skeletor Excel Worksheet Functions 5 October 1st 08 02:46 AM
Copy rows with a cell value 0 from several worksheets to a new sh Skeletor Excel Worksheet Functions 3 September 30th 08 09:45 AM
macro to copy multiple rows to separate worksheets OrlaH Excel Worksheet Functions 2 June 8th 06 03:15 PM
Need to copy rows in Sheet1 to different worksheets minx2001[_2_] Excel Programming 1 October 23rd 04 04:00 PM
Need to copy rows in Sheet1 to different worksheets minx2001 Excel Programming 1 October 23rd 04 10:13 AM


All times are GMT +1. The time now is 03:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"