Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub copydata1()
Dim sStr As String Dim dDate As Date Dim lDate As Long Dim cell As Range Dim rng As Range Dim rng1 As Range sStr = InputBox("Please enter the date") If IsDate(sStr) Then dDate = CDate(sStr) Else Exit Sub End If lDate = CLng(dDate) Set rng = Range(Cells(1, 1), Cells(Rows.Count, 1).End(xlUp)) For Each cell In rng If cell.Value2 = lDate Then If Not rng1 Is Nothing Then Set rng1 = Union(rng1, cell) Else Set rng1 = cell End If End If Next If Not rng1 Is Nothing Then rng1.Resize(, 3).Copy Destination:=Worksheets("Sheet2").Range("A1") End If End Sub -- Regards, Tom Ogilvy "jessica" wrote in message ... Thank you Paul, but I don't want to use autofilter. I want to get the filtered value from input box, then loop until cursor gets to cell with value inserted to input box. Then set selection start. Loop until it gets to the last row with inserted date value and set selection end. Waiting for your help, Jessica ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select between rows | Excel Discussion (Misc queries) | |||
Cannot select rows in VBA | Excel Discussion (Misc queries) | |||
How can i randomly select 780 rows from 4000 rows of data | Excel Worksheet Functions | |||
select rows | Excel Worksheet Functions | |||
Unable to select rows in the repeat rows on top option | Excel Discussion (Misc queries) |