Named Ranged, help please

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

Cell E3 is called "Latest"

In this column I offset to paste vlaues in from other sheets intop the
relvant ow (determined by the offset - could you Lookup I guess).
However do I need to Dim the range to ge tthe following to work?

MyWBAccRep.Sheets("Volumes").Range("Latest").Copy
Destination:=Range("Latest").Offset(0, 1)

Thanks
 
Named ranges are not part of a workbook but part of the application level of
a workbook. Try this

from
MyWBAccRep.Sheets("Volumes").Range("Latest").Copy

to
MyWBAccRep.application.Sheets("Volumes").Range("Latest").Copy
 
You need to be explicit with your references. You are good on the copy but
you are not explicit on your destination...

With MyWBAccRep.Sheets("Volumes").Range("Latest")
.Copy Destination:=.Offset(0, 1)
end with

What you have is equavalent to
MyWBAccRep.Sheets("Volumes").Range("Latest").Copy
Destination:=Activesheet.Range("Latest").Offset(0, 1)

so if Latest is not on the active sheet it will bomb...
 
I think you are mistaken. Range names are either tied to the Workbook for
global named ranges or to the worksheet for local named ranges. The Object
Model is
Application -> Workbooks -> Worksheets
The appliation contains 0 or more workbooks. A Workbook contains 1 or more
worksheets. A workbook can not contain an application.

If you check the value of Thisworkbook.Application and ThisWorkbook.Parent
you will see that they are both the same.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top