VBA Copy/Paste from an existing Workbook to a temporary Workbook

Michael Yau

New Member
Joined
Dec 9, 2014
Messages
1
Hi,

I've been browsing on this site to look for solution but still no help. I am looking for a code that will copy a cell from an existing workbook and paste to a temporary workbook.

I ran a macro and it created a temporary workbook. I ensured that the temporary workbook is still selected when the codes below are entered.

I am not "dim-ming" the saved workbook as I can simply type the code since it has a name (automation). I want to copy the E7 Cell from the saved workbook called Automation and paste it on E1 Cell on the unsaved workbook. After having pasted the copied data on cell E1, I want to change the cell format to Short Date.


Dim wbunsaved As Workbook</SPAN>
Set wbunsaved = ThisWorkbook <<<THE SPAN code< this inputing when selected is workbook unsaved>


Workbooks("Automation.Xlsm").Sheets("automation").Range("E7").Select</SPAN>
Selection.Copy</SPAN>
Workbooks("thisworkbook").Sheets("summary").Range("E1").Select</SPAN>
Selection.Paste</SPAN>
Selection.NumberFormat = "m/d/yyyy"



Thanks for your help in advance.</SPAN>
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Watch MrExcel Video

Forum statistics

Threads
1,123,366
Messages
5,601,204
Members
414,434
Latest member
Riyen

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