LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Problem with named range as VBA macro parameter

Hi.

I have a VBA macro that takes a range as an input parameter. It does
things to cells in that range, then returns some interger value.

A cell on a worksheet calls this macro and passes the range in as a
named range. Note that the macro does not refer to the name, it just
takes the range as input.

The macro works great as long as the worksheet with the cell that
calls the macro is active. If I make a different worksheet active
(worksheet B), I find that when I return to the worksheet with the
cell that calls the macro (worksheet A), the value returned by the
macro is based on worksheet B. Once I do something to worksheet A,
the forumla gets called again, and the problem gets corrected.

The named range I pass to the macro is defined in relative terms (ie.,
with dollar signs) and is prefaced with the worksheet name that
contains the range. Here's what the ranges look like:

AssignedToHeading ='UC Scenario Status'!$M$6
AssignedToStart =OFFSET(AssignedToHeading,1,0)
AssignedToEnd =OFFSET('UC Scenario Status'!$M$25,-1,0)
AssignedToRange =AssignedToStart:AssignedToEnd

"AssignedToRange" is what I'm passing to the macro. The worksheet
with the range is "UC Scenario Status". That also contains the cell
that calls the macro.

So what's happening is that the worksheet name (UC Scenario Status)
seems to be getting ignored in the macro. What do I need to do to get
it noticed?

Thanks!

Ken
 
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
Problem with link to named range Victor Delta[_2_] Excel Discussion (Misc queries) 0 August 17th 09 02:49 PM
Find in Named Range problem (2nd Try) G.R. New Users to Excel 2 February 27th 08 08:17 PM
Series Named Range Problem Arturo Charts and Charting in Excel 1 July 3rd 07 09:31 PM
Problem with Dynamic Named Range Philip Excel Worksheet Functions 1 December 7th 06 04:09 PM
external named range problem JKC Excel Discussion (Misc queries) 0 March 7th 06 05:23 PM


All times are GMT +1. The time now is 05:10 PM.

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"