Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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...


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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...


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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....


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default 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...



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent... Getting error in accessing named ranges in excel 2007... Himanshu Nigam Excel Programming 1 May 18th 08 07:30 PM
Named ranges scope / workbook/worksheet level named ranges- changeswith variable use... christian_spaceman Excel Programming 3 December 24th 07 01:15 PM
Named Ranges - accessing a cell mojoweiss Excel Discussion (Misc queries) 1 September 1st 05 04:20 PM
Accessing named ranges in Excel from VBA Basz Excel Discussion (Misc queries) 1 August 10th 05 03:21 PM
Accessing Named Ranges Michael Monteiro Excel Programming 1 August 27th 03 05:29 PM


All times are GMT +1. The time now is 07:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"