Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello NG,
Does anybody have a macro that will move data from one sheet to another based on a set criteria? For example A 690 B 690 C 715 D 720 E 720 I would run a macro and it would copy entries A and B to a tab named 690, etc. Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See the second example
http://www.rondebruin.nl/copy5.htm -- Regards Ron de Bruin http://www.rondebruin.nl "SRS" wrote in message ... Hello NG, Does anybody have a macro that will move data from one sheet to another based on a set criteria? For example A 690 B 690 C 715 D 720 E 720 I would run a macro and it would copy entries A and B to a tab named 690, etc. Thanks in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim rng as Range
Dim wks as Worksheet Dim cell as Range set rng = Range(Cells(2,1),Cells(2,1).End(xldown)) for each cell in rng On error resume next set wks = Worksheets(format(cell.value,"@")) On Error goto 0 if not wks is nothing then cell.EntireRow.Copy _ destination:=wks.cells(rows.count,1).End(xlup)(2) end if Next Wil split out your data to sheets based on the value in column B This is a start - you can enrich it to do what you need. If you only want to do 690, then put in a if statement Dim rng as Range Dim wks as Worksheet Dim cell as Range set rng = Range(Cells(2,1),Cells(2,1).End(xldown)) for each cell in rng if clng(cell.Value) = 690 then On error resume next set wks = Worksheets(format(cell.value,"@")) On Error goto 0 if not wks is nothing then cell.EntireRow.Copy _ destination:=wks.cells(rows.count,1).End(xlup)(2) end if End if Next Code is untested, but represents a workable approach. -- Regards, Tom Ogilvy "SRS" wrote in message ... Hello NG, Does anybody have a macro that will move data from one sheet to another based on a set criteria? For example A 690 B 690 C 715 D 720 E 720 I would run a macro and it would copy entries A and B to a tab named 690, etc. Thanks in advance |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks
Ron "Ron de Bruin" wrote in message ... See the second example http://www.rondebruin.nl/copy5.htm -- Regards Ron de Bruin http://www.rondebruin.nl "SRS" wrote in message ... Hello NG, Does anybody have a macro that will move data from one sheet to another based on a set criteria? For example A 690 B 690 C 715 D 720 E 720 I would run a macro and it would copy entries A and B to a tab named 690, etc. Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Moving a line chart data point revises data table value in Excel ' | Charts and Charting in Excel | |||
Moving Data between sheets in the same workbook and moving data between Workbooks. | Excel Worksheet Functions | |||
Moving data from one worksheet to another whilst removing the data | Excel Discussion (Misc queries) | |||
moving data to non autofarmatted book changes data- Why? | Excel Discussion (Misc queries) | |||
moving data in excel without deleting existing data | Excel Discussion (Misc queries) |