Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
in Excel how do I copy & paste a grouping as one? | Charts and Charting in Excel | |||
Finding row, then copy paste (macro) | Excel Discussion (Misc queries) | |||
Copy Paste from Class Sheet to Filtered List on Combined Sheet | Excel Programming | |||
Help to code Macro to Copy fron one sheet and paste in other sheet | Excel Programming | |||
Finding a named range based on cell value and copy/paste to same sheet? | Excel Programming |