Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there ever more than one item1 in col A and are there ever more than 2
other columns? Easier if yes. -- Don Guillett Microsoft MVP Excel SalesAid Software "Mike G - DC" wrote in message ... Folks - I'm looking for some code to copy data from worksheet A into Worksheet B like the following example. This code will fire as part of another macro. Any help is much appreciated. Thanks, Mike Worksheet A A B C 1 item1 10 20 2 item2 12 19 3 item3 13 89 Worksheet B A B 1 item1 10 2 item1 20 3 item2 12 4 item2 19 5 item3 13 6 item3 89 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Looks like my example may have adjusted a bit after the fact. Column A will
include an indefinite list of items. Although most will be unique there is a chance that there may be duplicate item names. My data set actually includes Data in columns A through O. Column A captures the item and column B through O capture a numeric count of the item each month. I limited my example thinking that I could modify the code. Any help is much appreciated. Thanks, Mike "Don Guillett" wrote: Is there ever more than one item1 in col A and are there ever more than 2 other columns? Easier if yes. -- Don Guillett Microsoft MVP Excel SalesAid Software "Mike G - DC" wrote in message ... Folks - I'm looking for some code to copy data from worksheet A into Worksheet B like the following example. This code will fire as part of another macro. Any help is much appreciated. Thanks, Mike Worksheet A A B C 1 item1 10 20 2 item2 12 19 3 item3 13 89 Worksheet B A B 1 item1 10 2 item1 20 3 item2 12 4 item2 19 5 item3 13 6 item3 89 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excellent! Thanks for the help.
"Don Guillett" wrote: This should work. Fire from the DESTINATION sheet Sub remakelist() Application.ScreenUpdating = False Sheets("sheet1").Columns("a:o").Copy Range("a1") For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1 Rows(i - 1).Insert For j = 2 To Cells(i, Columns.Count).End(xlToLeft).Column Cells(i, 1).Copy Cells(i - 1, 1) Cells(i, j).Copy Cells(i - 1, 2) Next j Next i Columns("A:B").Sort Key1:=Range("A1"), Order1:=xlAscending, _ Key2:=Range("B1"), Order2:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Columns("c:o").Delete Application.ScreenUpdating = True End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Mike G - DC" wrote in message ... Looks like my example may have adjusted a bit after the fact. Column A will include an indefinite list of items. Although most will be unique there is a chance that there may be duplicate item names. My data set actually includes Data in columns A through O. Column A captures the item and column B through O capture a numeric count of the item each month. I limited my example thinking that I could modify the code. Any help is much appreciated. Thanks, Mike "Don Guillett" wrote: Is there ever more than one item1 in col A and are there ever more than 2 other columns? Easier if yes. -- Don Guillett Microsoft MVP Excel SalesAid Software "Mike G - DC" wrote in message ... Folks - I'm looking for some code to copy data from worksheet A into Worksheet B like the following example. This code will fire as part of another macro. Any help is much appreciated. Thanks, Mike Worksheet A A B C 1 item1 10 20 2 item2 12 19 3 item3 13 89 Worksheet B A B 1 item1 10 2 item1 20 3 item2 12 4 item2 19 5 item3 13 6 item3 89 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can't Copy and Paste or Paste Special between Excel Workbooks | Excel Discussion (Misc queries) | |||
Automating copy/paste/paste special when row references change | Excel Programming | |||
help w/ generic copy & paste/paste special routine | Excel Programming | |||
Excel cut/Paste Problem: Year changes after data is copy and paste | Excel Discussion (Misc queries) | |||
Copy and Paste macro needs to paste to a changing cell reference | Excel Programming |