Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting ranges by dates
I am trying to write the code that will allow me to input date ranges
and copy the information by the date that it was entered. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting ranges by dates
Dim rng as Range, rng1 as Range Dim ans as String, Target as Long Dim res as Variant with worksheets("Sheet1") set rng = .range(.Cells(2,1),.Cells(2,1).End(xldown)) End with ans = Inputbox("Enter your date:") if cdate(ans) then target = clng(cdate(ans)) res = Application.match(target,rng,0) if not iserror(res) then set rng1 = rng(res) rng1.copy Destination:=worksheets("Sheet2").cells( _ rows.count,1).End(xlup)(2) else msgbox ans & " was not found" end if else msgbox ans & " is not a valid date" end if -- Regards, Tom Ogilvy " wrote: I am trying to write the code that will allow me to input date ranges and copy the information by the date that it was entered. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting Ranges | Excel Programming | |||
Selecting ranges | Excel Programming | |||
Selecting ranges with a text box | Excel Programming | |||
Selecting ranges with a text box | Excel Programming | |||
selecting ranges | Excel Programming |