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>
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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