Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Paste a Range from Excel to Excel
#1
Not Solved
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 -

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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to export the output value of a webedit object to a new excel file. mounika6677 1 1,330 04-14-2019, 05:18 PM
Last Post: mounika6677
  Access not saved excel file randhirsinghskhn 0 931 09-04-2018, 07:26 AM
Last Post: randhirsinghskhn
  How to paste file location in QTP camillelola 0 1,337 08-09-2018, 10:54 AM
Last Post: camillelola
  Add picture to Excel From UFT eiko 0 1,697 02-10-2018, 12:39 AM
Last Post: eiko
  How To Capture Array Value into Excel Worksheet? Studymode 0 1,305 01-09-2018, 08:37 AM
Last Post: Studymode

Forum Jump:


Users browsing this thread: 1 Guest(s)