Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub FindDates()
On Error GoTo errorHandler Dim startDate As String Dim stopDate As String Dim startRow As Integer Dim stopRow As Integer startDate = InputBox("Enter the Start Date: (mm/dd/yy)") If startDate = "" Then End stopDate = InputBox("Enter the Stop Date: (mm/dd/yy)") If stopDate = "" Then End startDate = Format(startDate, "mm/dd/yy") stopDate = Format(stopDate, "mm/dd/yy") startRow = Worksheets("MASTER").Columns("C").Find(startDate, _ LookIn:=xlValues, lookat:=xlWhole).Row stopRow = Worksheets("MASTER").Columns("C").Find(stopDate, _ LookIn:=xlValues, lookat:=xlWhole).Row Worksheets("MASTER").Range("B" & startRow & ":AZ" & stopRow).Copy _ Destination:=Worksheets("Sheet3").Range("A1") End errorHandler: MsgBox "There has been an error: " & Error() & Chr(13) _ & "Ending Sub.......Please try again", 48 End Sub My date is in column C. I sometimes have more than one with the same date. I select the dates with the input box and it gets all of the rows I want except if there is more than one with the same stopDate. The sheet has been sorted on the date column. I thought if I could search from the bottom up it would solve my problem. Could I get some help with the code to do a seartch from the bottom up? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find Specific date in Biwwekly Based on date | Excel Discussion (Misc queries) | |||
Julian date - find next highest date/number | Excel Worksheet Functions | |||
Find the date of the coming up Saturday given the current date. | Excel Worksheet Functions | |||
Using variables to make a date and using find method to find that. | Excel Programming | |||
Find date and copy range based on that date | Excel Programming |