mattygriff
Programmer
Thought it best to start a new thread for this one.
I'm importing data from one workbook (A) into another (B) using the INDIRECT() function. I have overcome the issue of INDIRECT() only working with open workbooks (thanks to everyone who assisted with that one) but now I have another issue.
Once the data has been imported, I don't want to have to open (B) in order to populate (A) every time (A) is opened so, to preserve the data originally imported from (B), I want to copy and paste the imported data in (A) as values.
The data is stored in cells which are in a named range (PREVIOUS_PSPD) and I'm not sure how (or indeed whether) I can refer to the range name in the copy / paste actions.
My current code is
When I run this code, I get a "Method 'Range' of object '_Global' failed" error message.
For info, the same range name is used (and refers to the same range of cells) in both (A) and (B).
Thanks in advance.
I'm importing data from one workbook (A) into another (B) using the INDIRECT() function. I have overcome the issue of INDIRECT() only working with open workbooks (thanks to everyone who assisted with that one) but now I have another issue.
Once the data has been imported, I don't want to have to open (B) in order to populate (A) every time (A) is opened so, to preserve the data originally imported from (B), I want to copy and paste the imported data in (A) as values.
The data is stored in cells which are in a named range (PREVIOUS_PSPD) and I'm not sure how (or indeed whether) I can refer to the range name in the copy / paste actions.
My current code is
Code:
Dim WB As Workbook
Set WB = Workbooks.Open(Prev_PSC_Filename)
Range("Previous_PSPD").Copy
Range("Previous_PSPD").PasteSpecial (xlPasteValues)
WB.Close SaveChanges:=False
Set WB = Nothing
For info, the same range name is used (and refers to the same range of cells) in both (A) and (B).
Thanks in advance.