Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
count a value in a date range based on a date in another workshee. | Excel Worksheet Functions | |||
Find Specific date in Biwwekly Based on date | Excel Discussion (Misc queries) | |||
Find category value based on date range? | Excel Worksheet Functions | |||
Need to find Min value based on date range entered | Excel Worksheet Functions | |||
Need to find Min value based on date range entered | Excel Worksheet Functions |