Find date, Copy Range, Paste Range in different Sheet

monteskiusz12

New Member
Joined
Jul 25, 2007
Messages
1
In Shee1.ColumnA I have dates (format 2006-01-01) from second row to last row. also In Sheet1.ColumnB and ColumnD I have data (no matter what)
2. The Program has to find date (which I choose from DTPicker) in Column A, select address of this cell where the date is found, from this cell(found row,ColumnA) i have to take ofsett(1,to ColumnB and then ColumnD) and select 24 rows below (because i have 24 value of temperature a day) copy them and Paste values in Sheet2 in Column A and cell where I want.

Shhet1 - something like data base with dates in column A and temperature n Column B and wind in COlumnC
Sheet2 - I choose several dates from DTPicker in year 2006 and 2005 to have specification of weather conditions

It has to work as search engin days in data base
Please for help to do macro
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
Hi
paste the following codes in the macro window ( Atl F11)

Code:
Sub pull()
a = Worksheets("sheet2").Cells(1, 1)
x = Cells(Rows.Count, 1).End(xlUp).Row
b = "A2:A" & x
Cells(1, 6) = "=match(sheet2!A1," & b & ",0)"
C = Cells(1, 6)
d = "A" & C + 1 & ":D" & C + 25
Range(d).Copy
y = Worksheets("sheet2").Cells(Rows.Count, 1).End(xlUp).Row
z = "a" & y + 2
Worksheets("sheet2").Range(z).PasteSpecial
End Sub
Enter date in Cell A1 of sheet2 and Run the macro. Repeat the process with different dates. It will search for the date, and copy col A to D and 24 rows below. Keep F1 free for calculation.
Ravi
 

Forum statistics

Threads
1,181,055
Messages
5,927,862
Members
436,573
Latest member
CMR237

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top