Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 184
Default Copy/Paste Macro using large amount of Data

Hi All:
Can you please tell me if there is a macro that will copy at each change in
Customer name and paste into a new worksheet. For example, if I have over
32,000 lines of data each subtotalled by Customer Name and Sales $, how can I
get a macro to copy each group and paste into a new worksheet. I have about
60 different customers so wanted to try to reduce some of the manual copy and
paste that is necessary.

Thanks to all for your response.

Nikki
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Copy/Paste Macro using large amount of Data

Hi Nikki,

You don't provide too much information but here's a start. Right click the
sheet tab of the sheet with your data in, view code and paste the code below
in.

It looks for a change in the name in column A and will copy the data to
sheet 2

Sub stance()
Dim MyRange
Dim copyrange As Range
Lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Set MyRange = Range("A1:A" & Lastrow)
For Each c In MyRange
If UCase(c.Value) < UCase(c.Offset(1).Value) Then

If copyrange Is Nothing Then
Set copyrange = c.EntireRow
Else
Set copyrange = Union(copyrange, c.EntireRow)
End If
End If
Next
If Not copyrange Is Nothing Then
copyrange.Copy Destination:=Sheets("Sheet2").Range("A1")
End If
End Sub

Mike

"Nikki" wrote:

Hi All:
Can you please tell me if there is a macro that will copy at each change in
Customer name and paste into a new worksheet. For example, if I have over
32,000 lines of data each subtotalled by Customer Name and Sales $, how can I
get a macro to copy each group and paste into a new worksheet. I have about
60 different customers so wanted to try to reduce some of the manual copy and
paste that is necessary.

Thanks to all for your response.

Nikki

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 184
Default Copy/Paste Macro using large amount of Data

Mike:
I will try this.
I have headers such as - Customer name, Sales$, and Sales Rep. I have sorted
by the highest sales $ first, and then subtotaled each Sales Rep. Now my task
is to copy the customer information by Sales Rep and paste it into a new
individual worksheet by Sales Rep. Make sense? I will try the code that you
gave me but please let me know if this will work.

Thanks agian.

Nikki

"Mike H" wrote:

Hi Nikki,

You don't provide too much information but here's a start. Right click the
sheet tab of the sheet with your data in, view code and paste the code below
in.

It looks for a change in the name in column A and will copy the data to
sheet 2

Sub stance()
Dim MyRange
Dim copyrange As Range
Lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Set MyRange = Range("A1:A" & Lastrow)
For Each c In MyRange
If UCase(c.Value) < UCase(c.Offset(1).Value) Then

If copyrange Is Nothing Then
Set copyrange = c.EntireRow
Else
Set copyrange = Union(copyrange, c.EntireRow)
End If
End If
Next
If Not copyrange Is Nothing Then
copyrange.Copy Destination:=Sheets("Sheet2").Range("A1")
End If
End Sub

Mike

"Nikki" wrote:

Hi All:
Can you please tell me if there is a macro that will copy at each change in
Customer name and paste into a new worksheet. For example, if I have over
32,000 lines of data each subtotalled by Customer Name and Sales $, how can I
get a macro to copy each group and paste into a new worksheet. I have about
60 different customers so wanted to try to reduce some of the manual copy and
paste that is necessary.

Thanks to all for your response.

Nikki

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
Macro stops with "Large Amount of Data" Message dhstein Excel Discussion (Misc queries) 4 November 12th 08 02:17 AM
Reformating large amount of data Jason Excel Discussion (Misc queries) 2 April 10th 08 10:41 PM
Changing large amount of Data glnbnz Excel Discussion (Misc queries) 5 January 12th 07 07:44 PM
Large amount of data for plotting dharshanie Charts and Charting in Excel 7 May 24th 06 05:08 PM
How do I paste a large amount of text into a cell ? Gal Mariansky Excel Discussion (Misc queries) 1 November 4th 05 05:31 PM


All times are GMT +1. The time now is 09:11 PM.

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

About Us

"It's about Microsoft Excel"