Pasting into another workbook using a lookup function

hughymung

New Member
Joined
Feb 5, 2014
Messages
2
Hi all,
I'm a newly registered member but have been a stalker of this site for the last week to try to learn the basics of macros. Was hoping someone could help me with my problem.

I am trying to copy a range from Workbook1 and paste it in to Workbook2, in a cell that is defined by a number in a cell (A1) from Workbook1 (or WB2).. Is there a way to do an alternative to a lookup function to select the right cell to paste in to?
This is what I have if the lookpup function worked:

Code:
 Sub COPYPASTE()
Windows("Workbook1.xlsm").Activate
 Range("o28:o107").Select
 Selection.Copy
 Windows("Workbook2.xlsm").Activate
 Range(LOOKUP(a1,E2:BE2,E4:BE4).Select
 Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
 :=True, Transpose:=False
End Sub

Really appreciate your help and time.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,223,228
Messages
6,170,875
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