LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 259
Default Finding, grouping, then copy/paste to new sheet

Hi All

As the subject states, I need to copy cName.Values from one sheet to
another, although, I don't need every instance of the cName.Values, just one
of each.

I then need it to go back again, find the Count of each cName, and repeat it
to find the Sum of each cName.

Dim SS As Sheet 'Source Sheet
Dim DS As Sheet 'Destination Sheet
Dim myRng As Range
Dim cName As String
Dim Sum_myCrng As Range

Set myRng = Range("F2:F200")
Set Sum_myCrng = Range("R2:R200")

eg

cName: MINS:
ABC Co. 50
XYZ Corp 250
ABC Co. 45
ABC Co. 100

So, for each cName in myRng I need to copy the name into
Sheets("Data").Column ("A").

I use the following to find the first empty cell along Column ("A")...

Columns("A").Find("", Cells(Rows.Count, "A"), xlValues, _
xlWhole, , xlNext).Select

Paste the cName from SS and repeat till one instance of all cNames has been
copied across to DS.

Next

Back to SS, count how many instances of each cName there are in myRng, then
go back to DS paste the Count.Value for each cName in Column ("A").Offset(0,
2) 'which is column C.

Next

Back to SS, Sum each cName there are in Sum_myCrng, then go back to DS paste
the Sum.Value for each cName in Column ("A").Offset(0, 1) 'which is column
B.
 
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
in Excel how do I copy & paste a grouping as one? DWP Charts and Charting in Excel 1 October 9th 09 01:32 PM
Finding row, then copy paste (macro) Edwin Excel Discussion (Misc queries) 5 July 15th 09 12:18 AM
Copy Paste from Class Sheet to Filtered List on Combined Sheet [email protected] Excel Programming 6 September 16th 08 04:30 PM
Help to code Macro to Copy fron one sheet and paste in other sheet kay Excel Programming 3 July 25th 08 06:46 PM
Finding a named range based on cell value and copy/paste to same sheet? Simon Lloyd[_715_] Excel Programming 1 May 11th 06 11:25 PM


All times are GMT +1. The time now is 10:09 AM.

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"