Accessing Named Ranges

  • Thread starter Thread starter Bruce A. Julseth
  • Start date Start date
B

Bruce A. Julseth

I'm trying to access some named ranges from with a VBA function.

For Example, I've a column of Cells (A3:A12) name "DataIn"

In my VBA Function GetData() I have
Dim Cell as Range

For each Cell in DataIn

' some Code

Next Cell

Well, this doesn't work. How can I address "DataIn?"

Thank you...
 
Try

Dim Cell As Range
For Each Cell In Range("DataIn")
'some code
Next Cell

If this post helps click Yes
 
For Each Cell In Worksheets("Sheet1").Range("DataIn").Cells
....do something
Next
 
Jacob Skaria said:
Try

Dim Cell As Range
For Each Cell In Range("DataIn")
'some code
Next Cell

If this post helps click Yes

Yah, that was the problem. I "FORGOT" to wrap the Named Column in Quotes.

Thanks....
 
Back
Top