Find date, Copy Range, Paste Range in different Sheet

monteskiusz12

New Member
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

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
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

Replies
4
Views
249
Replies
5
Views
477
Replies
5
Views
442
Replies
2
Views
470
Replies
2
Views
704

1,219,905
Messages
6,150,903
Members
450,991
Latest member
ExcelDoer

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.

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

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