ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Accessing Named Ranges (https://www.excelbanter.com/excel-programming/436684-accessing-named-ranges.html)

Bruce A. Julseth[_2_]

Accessing Named Ranges
 
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...



p45cal[_195_]

Accessing Named Ranges
 

For each Cell in Range("DataIn").cells

the .cells bit might not be necessary


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=157498

Microsoft Office Help


Jacob Skaria

Accessing Named Ranges
 
Try

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

If this post helps click Yes
---------------
Jacob Skaria


"Bruce A. Julseth" wrote:

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


.


Patrick Molloy

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

"Bruce A. Julseth" wrote in message
...
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...


Bruce A. Julseth[_2_]

Accessing Named Ranges
 

"Jacob Skaria" wrote in message
...
Try

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

If this post helps click Yes
---------------
Jacob Skaria


"Bruce A. Julseth" wrote:

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


.


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

Thanks....




All times are GMT +1. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com