10-27-2008, 04:11 PM
Hey guys,
Im need to copy a range of values in excel (say A1 - F5), and paste this range into another excel sheet. the reason for this is that im gathering alot of information form multiple excel sheets and putting it into one central sheet to call at runtime. So far ive written this but its just pasting blank into my sheet -
Can anyone see where im going wrong? any help would be greatly appreciated.
Thanks,
Brian
Im need to copy a range of values in excel (say A1 - F5), and paste this range into another excel sheet. the reason for this is that im gathering alot of information form multiple excel sheets and putting it into one central sheet to call at runtime. So far ive written this but its just pasting blank into my sheet -
Code:
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\sheet1.xls")
objExcel.Visible = True
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook2 = objExcel.Workbooks.Open("C:\sheet2.xls")
objExcel.Visible = True
Set objRange = objExcel.Range("F10","J35")
objRange.copy
objExcel.Range("F10","J35") = objRange
objExcel.Quit
Can anyone see where im going wrong? any help would be greatly appreciated.
Thanks,
Brian