Range in wrong book
Hi
Possibly you could store the address of the named range in a string
and then use that:
Dim strAddress as String
strAddress =
Split(Workbooks("YourBookWithTheNamedRange").Names ("month").RefersTo,"!")
(1)
m = Application.VLookup(Chr(ce.Column + 64), Range(strAddress), 2, 0)
Hope this helps!
Richard
On 8 Feb, 08:51, Newbie wrote:
Hi
I am using code to loop through all the files in a folder, read some data,
write back to the book containing the code and move on to the next book.
Part of my code has the following line:
m = Application.VLookup(Chr(ce.Column + 64), Range("month"), 2, 0)
Trouble is the named range is not in the book being read hence it doesn't
work. Is there an eaasier way other than copy the named range to every
workbook being read?
|