E
Ed
I am trying to loop through the ranges in my workbook and set a string to
the values of the first two cells in each range. I can access the Names
collection and get the name as Sheet and Cell identifiers
(Sheet1!$A$1:$A$4), and I can use the .Name property to get the name I gave
the range. But I can't seem to get the range itself to get the values from
the Cells(1,1) and Cells(1,2).
Ed
Set wb = ActiveWorkbook
On Error Resume Next
For Each rngName In wb.Names
rngName.RefersToRange.Select
strRng = rngName.Name
rngWork = ActiveWorkbook.Range(rngName.Name)
strOptn = rngWork.Cells(1, 1).Value
strOptn = strOptn & " Size " & rngWork.Cells(1, 2).Value
MsgBox strOptn
Next rngName
On Error GoTo 0
the values of the first two cells in each range. I can access the Names
collection and get the name as Sheet and Cell identifiers
(Sheet1!$A$1:$A$4), and I can use the .Name property to get the name I gave
the range. But I can't seem to get the range itself to get the values from
the Cells(1,1) and Cells(1,2).
Ed
Set wb = ActiveWorkbook
On Error Resume Next
For Each rngName In wb.Names
rngName.RefersToRange.Select
strRng = rngName.Name
rngWork = ActiveWorkbook.Range(rngName.Name)
strOptn = rngWork.Cells(1, 1).Value
strOptn = strOptn & " Size " & rngWork.Cells(1, 2).Value
MsgBox strOptn
Next rngName
On Error GoTo 0