Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find date and copy range based on that date


Hi,

I'd like to have a VBA routine who does the following:

- Look in a cell what date is stored in it.
- Find that date in a very large column 'A'.
- Select the found date in column 'A' together with the next 5 column
and 5 rows down.
- Copy this range to another location.

Please, respond

--
avzunder
-----------------------------------------------------------------------
avzundert's Profile: http://www.excelforum.com/member.php...fo&userid=1680
View this thread: http://www.excelforum.com/showthread.php?threadid=32017

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find date and copy range based on that date

Not perfect, but should get you started:

Sub test()
Dim irow As Long
Dim ival As Range, icol As Range
Dim idesta As Range

Set ival = Sheets("Sheet2").Range("F1")
Set icol = Sheets("Sheet2").Range("A:A")
Set idest = Sheets("Sheet3").Range("A1")

irow = 0
On Error Resume Next
irow = Application.WorksheetFunction. _
Match(ival, icol, 0)
On Error GoTo 0

If irow < 0 Then
Range("A" & irow).Resize(5, 6).Copy (idest)
Else
MsgBox ival & " not found."
End If

End Sub

---

F1 contains the value to look for, and the "other
location" to copy to is Sheet3!A1.

HTH
Jason
Atlanta, GA

-----Original Message-----

Hi,

I'd like to have a VBA routine who does the following:

- Look in a cell what date is stored in it.
- Find that date in a very large column 'A'.
- Select the found date in column 'A' together with the

next 5 columns
and 5 rows down.
- Copy this range to another location.

Please, respond.


--
avzundert
---------------------------------------------------------

---------------
avzundert's Profile:

http://www.excelforum.com/member.php?
action=getinfo&userid=16808
View this thread:

http://www.excelforum.com/showthread...hreadid=320171

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find date and copy range based on that date


Thanks Jason, for your quick response! I think it helps to solve m
problem. :

--
avzunder
-----------------------------------------------------------------------
avzundert's Profile: http://www.excelforum.com/member.php...fo&userid=1680
View this thread: http://www.excelforum.com/showthread.php?threadid=32017

Reply
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
count a value in a date range based on a date in another workshee. marsjune68 Excel Worksheet Functions 4 April 9th 09 10:31 PM
Find Specific date in Biwwekly Based on date jlclyde Excel Discussion (Misc queries) 3 January 27th 09 09:15 PM
Find category value based on date range? thewiz1972 Excel Worksheet Functions 5 June 10th 06 03:28 AM
Need to find Min value based on date range entered Chad S Excel Worksheet Functions 0 October 28th 04 08:03 PM
Need to find Min value based on date range entered Chad S Excel Worksheet Functions 1 October 28th 04 09:52 AM


All times are GMT +1. The time now is 04:46 PM.

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"