ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   opening files (https://www.excelbanter.com/excel-programming/370673-opening-files.html)

enyaw

opening files
 
I have a template that allows a user to input information into a worksheet
and copy to a new workbook. How would i go about coding opening the new
workbook and returning the information back into the template because the
person might want to edit it?

Tom Ogilvy

opening files
 

Dim bk as Workbook
set bk = Workbooks.Open("C:\MyFolder\Myfile.xls")
thisworkbook.Worksheets("Data").Range("A1:A10").co py _
Destination:=bk.Worksheets(1).Range("B9")

in another procedure to be run after the edit

workbooks("Myfile.xls").worksheets(1).Range("b9"). Resize(1,10).copy
Destination:=Workbooks("MyTemplate.xls").Worksheet s("Data").Range("A1")

--
Regards,
Tom Ogilvy


"enyaw" wrote:

I have a template that allows a user to input information into a worksheet
and copy to a new workbook. How would i go about coding opening the new
workbook and returning the information back into the template because the
person might want to edit it?



All times are GMT +1. The time now is 10:16 PM.

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