Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is this an efficient use of named cells?


Hi,

Let's say I want to be able to use one of 3 different configurations in
a sheet. The configuration in use is controlled by a combo box. One of
the things that is determined by the configuration is a discount rate.

The way I have defined this is as follows:
I specify each rate in a separate cell, and name the cells rate_1,
rate_2 and rate_3.
I have another cell that contains the rate in use, named rate_in_use.
In the code for the combo box change event, I have the following:

Code:
--------------------
If configuration = 1 Then
ActiveWorkbook.Names("rate_in_use").RefersTo = ActiveWorkbook.Names("rate_1").RefersTo
Else etc.
--------------------

All of the cells that need this discount rate can now refer to the cell
named rate_in_use.

I have repeated this technique for several other cells that are
dependent on which configuration is selected.

Is this an efficient way of doing what I want to do, and are there any
alternatives? The one thing that I wouldn't want to change is the use
of a combo box to choose the configuration.

(note that the code above could be improved by just appending the
configuration number to the end of the name, but I didn't show it here
so as to make the example easier)

Thanks,
Vindaloo


--
Vindaloo
------------------------------------------------------------------------
Vindaloo's Profile: http://www.excelforum.com/member.php...o&userid=32634
View this thread: http://www.excelforum.com/showthread...hreadid=526100

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Is this an efficient use of named cells?

Looks like a workable approach to me.

--
Regards,
Tom Ogilvy


"Vindaloo" wrote:


Hi,

Let's say I want to be able to use one of 3 different configurations in
a sheet. The configuration in use is controlled by a combo box. One of
the things that is determined by the configuration is a discount rate.

The way I have defined this is as follows:
I specify each rate in a separate cell, and name the cells rate_1,
rate_2 and rate_3.
I have another cell that contains the rate in use, named rate_in_use.
In the code for the combo box change event, I have the following:

Code:
--------------------
If configuration = 1 Then
ActiveWorkbook.Names("rate_in_use").RefersTo = ActiveWorkbook.Names("rate_1").RefersTo
Else etc.
--------------------

All of the cells that need this discount rate can now refer to the cell
named rate_in_use.

I have repeated this technique for several other cells that are
dependent on which configuration is selected.

Is this an efficient way of doing what I want to do, and are there any
alternatives? The one thing that I wouldn't want to change is the use
of a combo box to choose the configuration.

(note that the code above could be improved by just appending the
configuration number to the end of the name, but I didn't show it here
so as to make the example easier)

Thanks,
Vindaloo


--
Vindaloo
------------------------------------------------------------------------
Vindaloo's Profile: http://www.excelforum.com/member.php...o&userid=32634
View this thread: http://www.excelforum.com/showthread...hreadid=526100


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
What is more efficient Brad Excel Discussion (Misc queries) 2 November 20th 06 09:13 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
Is there a more efficient way to do this? Steve Roberts Excel Programming 1 September 26th 05 05:34 PM
More efficient way? Steph[_3_] Excel Programming 6 June 23rd 04 09:34 PM
Which is more efficient? Norm[_5_] Excel Programming 3 April 2nd 04 04:24 PM


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

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

About Us

"It's about Microsoft Excel"