Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have two dates - a start date in A1 and an end date in B1. I want to select
all rows containing dates in that range, copy them and paste to a new worksheet within the same workbook. The date column is sorted early to late dates. -- Best regards, Drew Yallop |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Public Sub Test()
Dim StartRow As Long Dim EndRow As Long With ActiveSheet On Error Resume Next StartRow = Application.Match(CLng(.Range("A1").Value), ..Range("rngDates"), 0) On Error GoTo 0 If StartRow = 0 Then MsgBox "Start date not matched" Exit Sub End If On Error Resume Next EndRow = Application.Match(CLng(.Range("B1").Value), ..Range("rngDates"), 0) On Error GoTo 0 If EndRow = 0 Then MsgBox "End date not matched" Exit Sub End If .Range("rngDates").Cells(StartRow, 1).Resize(EndRow - StartRow + 1).Copy _ Worksheets("Sheet2").Range("A1") End With End Sub -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "thomasDrew" wrote in message ... I have two dates - a start date in A1 and an end date in B1. I want to select all rows containing dates in that range, copy them and paste to a new worksheet within the same workbook. The date column is sorted early to late dates. -- Best regards, Drew Yallop |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select a range of rows to delete | Excel Worksheet Functions | |||
How can change range to select active rows instead of :=Range("S10 | Excel Discussion (Misc queries) | |||
Select range of rows/Columns? | Excel Programming | |||
Select always same Rows range | Excel Discussion (Misc queries) | |||
How to select rows containing certain date | Excel Programming |