#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Moving Data

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Moving Data

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Moving Data

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Moving Data

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
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
Moving a line chart data point revises data table value in Excel ' Ed Smith Charts and Charting in Excel 2 November 16th 12 01:03 PM
Moving Data between sheets in the same workbook and moving data between Workbooks. Alison Brown Excel Worksheet Functions 0 February 10th 09 01:03 AM
Moving data from one worksheet to another whilst removing the data Dobbin0_4[_2_] Excel Discussion (Misc queries) 2 September 17th 08 03:31 PM
moving data to non autofarmatted book changes data- Why? Josh Excel Discussion (Misc queries) 3 March 10th 06 09:16 PM
moving data in excel without deleting existing data jigna Excel Discussion (Misc queries) 1 January 30th 05 11:35 AM


All times are GMT +1. The time now is 06:50 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"