Accessing Named Ranges

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...
 
J

Jacob Skaria

Try

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

If this post helps click Yes
 
P

Patrick Molloy

For Each Cell In Worksheets("Sheet1").Range("DataIn").Cells
....do something
Next
 
B

Bruce A. Julseth

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....
 

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

Top