capturing Data and printing line elsewhere

G

Guest

I am wanting to be able to take a row of data that ends with a date and based
on the date move that entire line to another sheet or to a specific location
on my drive:
for example

A B C
D
1] john Dee enter ga-01
06/05/2007
2] jane lane outer ga-02
07/10/2007
3] dan land enter ga-01
08/01/2007
4] Pea Body enter ga-01
07/26/2007

Now I want to capture the dates in column D that are after 07/01/2007 and
list them in order on another page.
 
D

Dave Peterson

I'd apply data|filter|autofilter and use that to show the rows I wanted to see.
I wouldn't create another copy.

But if you had to, you could copy the visible rows and paste into any other
worksheet you wanted.

d_kight said:
I am wanting to be able to take a row of data that ends with a date and based
on the date move that entire line to another sheet or to a specific location
on my drive:
for example

A B C
D
1] john Dee enter ga-01
06/05/2007
2] jane lane outer ga-02
07/10/2007
3] dan land enter ga-01
08/01/2007
4] Pea Body enter ga-01
07/26/2007

Now I want to capture the dates in column D that are after 07/01/2007 and
list them in order on another page.
 
G

Guest

Sub tester()
Dim SCell As String
SCell = Range("D1")
Set STest = Range("A4").Range("D1:D4")
i = 1
j = 2
For Each Cell In STest
If CDate(SCell) <= STest(i) Then
Cell.EntireRow.Cut Destination:=Sheets("Sheet3").Cells(j, "A")
j = j + 1
End If
i = i + 1
Next Cell
Sheets("Sheet3").Activate
Range("A2").CurrentRegion.Sort Key1:=Range("D1"), Order1:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

Try this **ON A BACK UP COPY **

Write back if problems,,,,

Jim May
 
G

Guest

THANKS JIM, I WILL GIVE THAT A GO AND LET YOU KNOW HOW IT TURNED OUT.

Jim May said:
Sub tester()
Dim SCell As String
SCell = Range("D1")
Set STest = Range("A4").Range("D1:D4")
i = 1
j = 2
For Each Cell In STest
If CDate(SCell) <= STest(i) Then
Cell.EntireRow.Cut Destination:=Sheets("Sheet3").Cells(j, "A")
j = j + 1
End If
i = i + 1
Next Cell
Sheets("Sheet3").Activate
Range("A2").CurrentRegion.Sort Key1:=Range("D1"), Order1:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

Try this **ON A BACK UP COPY **

Write back if problems,,,,

Jim May



d_kight said:
I am wanting to be able to take a row of data that ends with a date and based
on the date move that entire line to another sheet or to a specific location
on my drive:
for example

A B C
D
1] john Dee enter ga-01
06/05/2007
2] jane lane outer ga-02
07/10/2007
3] dan land enter ga-01
08/01/2007
4] Pea Body enter ga-01
07/26/2007

Now I want to capture the dates in column D that are after 07/01/2007 and
list them in order on another page.
 
G

Guest

THNKS AGAIN, JIM BUT THERE SEEMS TO BE SOMETHING INCORRECT ABOUT THE CODE AT
THIS POINT CurrentRegion.Sort Key1:=Range("D1"), Order1:=xlAscending,
I THINK USINF THE "|" SYMBOL IS NOT LIKE BY THE VB EDITOR. IS THERE ANOTHER
WAY OR AM i SEEING THAT INCORRECTLY?

AGAIN, THANKS FOR ANY HELP THAT COULD BE PROVIDED IN ADVANCED. (NOT YELLING,
TRYING TO MAKE IT STAND OUT.)

Jim May said:
Sub tester()
Dim SCell As String
SCell = Range("D1")
Set STest = Range("A4").Range("D1:D4")
i = 1
j = 2
For Each Cell In STest
If CDate(SCell) <= STest(i) Then
Cell.EntireRow.Cut Destination:=Sheets("Sheet3").Cells(j, "A")
j = j + 1
End If
i = i + 1
Next Cell
Sheets("Sheet3").Activate
Range("A2").CurrentRegion.Sort Key1:=Range("D1"), Order1:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

Try this **ON A BACK UP COPY **

Write back if problems,,,,

Jim May



d_kight said:
I am wanting to be able to take a row of data that ends with a date and based
on the date move that entire line to another sheet or to a specific location
on my drive:
for example

A B C
D
1] john Dee enter ga-01
06/05/2007
2] jane lane outer ga-02
07/10/2007
3] dan land enter ga-01
08/01/2007
4] Pea Body enter ga-01
07/26/2007

Now I want to capture the dates in column D that are after 07/01/2007 and
list them in order on another page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top