ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   capturing Data and printing line elsewhere (https://www.excelbanter.com/excel-discussion-misc-queries/154177-capturing-data-printing-line-elsewhere.html)

d_kight

capturing Data and printing line elsewhere
 
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.

Dave Peterson

capturing Data and printing line elsewhere
 
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 wrote:

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.


--

Dave Peterson

Jim May

capturing Data and printing line elsewhere
 
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" wrote:

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_kight

capturing Data and printing line elsewhere
 
THANKS JIM, I WILL GIVE THAT A GO AND LET YOU KNOW HOW IT TURNED OUT.

"Jim May" wrote:

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" wrote:

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_kight

capturing Data and printing line elsewhere
 
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" wrote:

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" wrote:

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.



All times are GMT +1. The time now is 04:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com