xcelnovice
Board Regular
- Joined
- Dec 31, 2011
- Messages
- 81
So I am trying to slowly piece together a macro through trial and error (Mostly just error) Below is the very first part I need to accomplish & I get to here
wbTarget.Sheets("AB").Range("A:H").Paste 'Last line
And i get runtime error 438 Object doesnt support this property or method
I'm sure there are things in here that make no sense but Im trying to babystep through it..Thanks
1) Open both workbooks (target & source)
2)Copy range in source
3)Paste to target
Sub CostMgmtUpdate() 'Name of my program
Dim wbTarger As Workbook 'Cost Management report where data will be pasted
Dim wbSource As Workbook 'BTD File where data is pulled from
'Open both workbooks
Set wbTarget = Workbooks.Open("C:\Users\E7HP\Desktop\JH CLIN 0005 November 2015 SLIN Budget (CMS ART) vs Actuals (Costpoint)-COPY.xlsm")
Set wbSource = Workbooks.Open("C:\Users\E7HP\Desktop\JH A MIP-COPY.xlsx")
'Now transfer data from source to target
wbSource.Sheets("JH A MIP-COPY").Range("A:H").Copy
wbTarget.Sheets("AB").Range("A:H").Paste
wbTarget.Sheets("AB").Range("A:H").Paste 'Last line
And i get runtime error 438 Object doesnt support this property or method
I'm sure there are things in here that make no sense but Im trying to babystep through it..Thanks
1) Open both workbooks (target & source)
2)Copy range in source
3)Paste to target
Sub CostMgmtUpdate() 'Name of my program
Dim wbTarger As Workbook 'Cost Management report where data will be pasted
Dim wbSource As Workbook 'BTD File where data is pulled from
'Open both workbooks
Set wbTarget = Workbooks.Open("C:\Users\E7HP\Desktop\JH CLIN 0005 November 2015 SLIN Budget (CMS ART) vs Actuals (Costpoint)-COPY.xlsm")
Set wbSource = Workbooks.Open("C:\Users\E7HP\Desktop\JH A MIP-COPY.xlsx")
'Now transfer data from source to target
wbSource.Sheets("JH A MIP-COPY").Range("A:H").Copy
wbTarget.Sheets("AB").Range("A:H").Paste