VBA Macro to find, offset and paste data

robersha

New Member
Joined
Nov 7, 2013
Messages
27
Hey all,

I have a spreadsheet with 4 sheets. Sheet1 contains 9 columns (C:K). Column C has a list of dates for the year. Sheet2 has data pulled from the web and the cell i need is ("E9"). Sheet3 is also another web pull and the cells i need are ("K19") and ("K24"). Sheet4 also pulls data from the web and i need the cell "(E9").

What I need to do, is create a macro that searches for the date entered in Sheet1.Range("N3") and find it in Sheet1.Range("C:C"). Then offset and paste the 4 cells listed above in the columns adjacent to the cell where the date is located in Column C.

Sheet1:
Column C = Date found
Column D = Sheet2.Range("E9")
Column F = Sheet3.Range("K19")
Column H = Sheet3.Range("K24")
Column J = Sheet4.Range("E9")

Any suggestions?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I figured it out. I used the following code and added it to the end of my current macro:

Code:
Sheet1.Select
        Cells.Find(What:=Sheet1.Range("N3"), After:=Sheet1.Range("C3"), LookIn:=xlValues, SearchORder:=xlByRows).Select
        Selection.Offset(, 2).Value = Sheet2.Range("E9")
        Selection.Offset(, 4).Value = Sheet3.Range("K19")
        Selection.Offset(, 6).Value = Sheet4.Range("E9")
        Selection.Offset(, 8).Value = Sheet3.Range("K24")
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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
Back
Top