LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Extract Rows By Date

Hi Randy,

Here's some code that will capture all rows with dates between 9th Jan in
column A, and 3rd Feb in column B

Worksheets("Sheet2").Cells.ClearContents
With Worksheets("Sheet3")
.Range("A1").EntireRow.Insert
With .Columns("A:B")
.AutoFilter Field:=1, Criteria1:="=09-Jan", Operator:=xlAnd
.AutoFilter Field:=2, Criteria1:="<=03-Feb", Operator:=xlAnd
End With
.Cells.SpecialCells(xlCellTypeVisible).Copy
Worksheets("Sheet2").Activate
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
.Range("A1").EntireRow.Delete
.Range("A1").EntireRow.Delete
End With


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Randy Walker" wrote in message
...
I know a little about this excel and less about programming but was

directed here by a friend to try and find an answer. I have looked through
the posts but can't find anything that seems to answer my question.
Although since I am not exactly sure what to do, maybe this has already been
answered before.

I have a sheet full of data - over 20,000 rows right now and it gets

longer each month. I need a macro that will pull out any row of data that
has a date value between two that I select. I need this data for ad-hoc
reports. I sorry if this is confusing. Basically on sheet1 in "A1" and
"A2" I would put two dates. Then it would pull out any row that has a date
in column A that is between these two dates and paste it on sheet2. That
sheet with all the data is sheet3.

If there is a way to do this that would be great as I have to pull alot of

stuff out of this and this would save me alot of time sorting and searching.

Thanks for taking the time to look at this and for any help that you can

provide.

Thanks,

Randy Walker



 
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
Auto extract data & inserts rows additional rows automatically Meeru Excel Discussion (Misc queries) 3 September 9th 09 01:46 PM
Extract rows from a list RichUE Excel Discussion (Misc queries) 2 March 11th 09 09:25 AM
Extract rows from workbooks Dave Excel Discussion (Misc queries) 2 May 8th 08 05:31 PM
many rows for 1 ref#, need to extract 1st row only for 1 ref# J LI Excel Discussion (Misc queries) 1 March 17th 06 06:26 PM
extract data from a range of cells in rows or columns when a date. Dartyon Excel Worksheet Functions 0 February 24th 05 10:37 PM


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