View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T[_5_] Peter T[_5_] is offline
external usenet poster
 
Posts: 84
Default Easy code, confounded by error

That error might be because the Name doesn't exist, or it doesn't refer to a
range, or it refers to more than one cell, or it has refers to a range
that's been removed (a ref error), or it's a worksheet level name and the
sheet is not active.

How far do you get with this

Dim rng As Range
Dim nm As Name
Set nm = ActiveWorkbook.Names("statusBarMsg")
Set rng = nm.RefersToRange
Debug.Print rng.Address
Debug.Print rng.Value2

Regards,
Peter T


wrote in message
...
I'm simply trying to get the text stored in a cell that has its own named
range. I keep getting a "Method 'Range' of 'object _Global' failed" error.
Here is the code:

Dim temp As String
temp = Range("statusBarMsg").Value2

What can I be missing here? Thanks.