PC Review


Reply
Thread Tools Rate Thread

Accessing Named Ranges

 
 
Bruce A. Julseth
Guest
Posts: n/a
 
      26th Nov 2009
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 With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      26th Nov 2009
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...
>
>
> .
>

 
Reply With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      26th Nov 2009
For Each Cell In Worksheets("Sheet1").Range("DataIn").Cells
....do something
Next

"Bruce A. Julseth" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> 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 With Quote
 
Bruce A. Julseth
Guest
Posts: n/a
 
      26th Nov 2009

"Jacob Skaria" <(E-Mail Removed)> wrote in message
news:6115F75E-8FFD-44B0-ABD0-(E-Mail Removed)...
> 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....


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent... Getting error in accessing named ranges in excel 2007... Himanshu Nigam Microsoft Excel Programming 1 18th May 2008 07:30 PM
Named Ranges - accessing a cell =?Utf-8?B?bW9qb3dlaXNz?= Microsoft Excel Misc 1 1st Sep 2005 04:20 PM
Accessing named ranges in Excel from VBA Basz Microsoft Excel Misc 1 10th Aug 2005 03:21 PM
Excel VBA - Accessing row and column indices from named ranges? billy600 Microsoft Excel Misc 2 7th Jul 2004 11:26 AM
Accessing Named Ranges Michael Monteiro Microsoft Excel Programming 1 27th Aug 2003 05:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:03 PM.