ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to copy cells from one workbook to another (https://www.excelbanter.com/excel-programming/346172-macro-copy-cells-one-workbook-another.html)

mwc0914[_9_]

macro to copy cells from one workbook to another
 

I am trying to write a macro that will copy cells from one workbook to
another. The catch is that the name of the source workbook may have
been changed from when it was originally saved, so the macro can not
refer to the source workbook by name.

I have a work-around macro I run from my source workbook that copies
cells from my source workbook to a temp.xls file, then I copy from
temp.xls to my desitnation workbook (file name is known), but then I
need to be able to delete the temp.xls workbook from my macro that I am
running from my source workbook. What is the macro command to delete a
xls file?


--
mwc0914
------------------------------------------------------------------------
mwc0914's Profile: http://www.excelforum.com/member.php...o&userid=24130
View this thread: http://www.excelforum.com/showthread...hreadid=486912


RonaldF

macro to copy cells from one workbook to another
 
Sub deletemap()
'Delete the file Temp.xls form the harddisk
Kill "C:\Temp.xls"
End Sub

Is this what you want???

--
Ronald Ferdinandus
http://www.ro-pay.nl


"mwc0914" wrote:


I am trying to write a macro that will copy cells from one workbook to
another. The catch is that the name of the source workbook may have
been changed from when it was originally saved, so the macro can not
refer to the source workbook by name.

I have a work-around macro I run from my source workbook that copies
cells from my source workbook to a temp.xls file, then I copy from
temp.xls to my desitnation workbook (file name is known), but then I
need to be able to delete the temp.xls workbook from my macro that I am
running from my source workbook. What is the macro command to delete a
xls file?


--
mwc0914
------------------------------------------------------------------------
mwc0914's Profile: http://www.excelforum.com/member.php...o&userid=24130
View this thread: http://www.excelforum.com/showthread...hreadid=486912




All times are GMT +1. The time now is 05:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com