A
Allen the Computer Guy
I need to copy an entire worksheet from one workbook to another. Currently,
i am using the following code:
Set objExcel = CreateObject("Excel.Application")
set objWorkbook = objExcel.Workbooks.Open(Filename1)
set objWorksheet = objworkbook.worksheets(1)
objExcel.displayalerts=false
Set objRange = objWorksheet.UsedRange
objRange.copy
set objworkbook = objExcel.workbooks.open(filename2)
set objworksheet = objworkbook.worksheets("FS Data")
Set objRange2 = objexcel.Range("A1")
objrange2.activate
objworksheet.paste
objworkbook.save
My data gets there, but only if i never edit the destination sheet or even
type on it. I need my copy to always start in A1. It does not. the copy
will start from whereever the cursor was last on that sheet when the file was
saved. I have to start sharing the script and the file with other users who
will not be as careful as i will.
i am using the following code:
Set objExcel = CreateObject("Excel.Application")
set objWorkbook = objExcel.Workbooks.Open(Filename1)
set objWorksheet = objworkbook.worksheets(1)
objExcel.displayalerts=false
Set objRange = objWorksheet.UsedRange
objRange.copy
set objworkbook = objExcel.workbooks.open(filename2)
set objworksheet = objworkbook.worksheets("FS Data")
Set objRange2 = objexcel.Range("A1")
objrange2.activate
objworksheet.paste
objworkbook.save
My data gets there, but only if i never edit the destination sheet or even
type on it. I need my copy to always start in A1. It does not. the copy
will start from whereever the cursor was last on that sheet when the file was
saved. I have to start sharing the script and the file with other users who
will not be as careful as i will.