Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default referencing a named range using a variable

referencing a workbook which is open, but not active, i'm trying to get the
value contained in a named range by referencing the name using a variable
defined by the sub

workbook name (inactive): Job Nos for Timesheets.xls
worksheet name: Billing Rates
named range that i'm trying (in this example) to access: rate_Staff
definition of rate_Staff (in the workbook) ='Billing Rates'!$B$7

variable name (that i'm using to reference the name i'm trying to get
the value of): strFeeRateDefaultRange

named range in the active sheet: [EmployeePosition]
value of [EmployeePosition] = "Staff"
strFeeRateDefaultRange = "Rate" & [EmployeePosition]

Set feerate = Workbooks("Job Nos for
Timesheets.xls").Names([strFeeRateDefaultRange]).RefersToRange
rate = feerate.Value
MsgBox ("using default fee rate: " & feerate.Value)

however, the result is not the value of the rate_Staff, but "='Billing
Rates'!$B$7"



me + named ranges = bad combination (don't know why, just have never gotten
the logic...)
thanks in advance
mark



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
Referencing a named range on another sheet Jan B Excel Worksheet Functions 5 April 4th 23 12:38 PM
referencing a 3D Named Range Robert H Excel Worksheet Functions 3 January 14th 08 05:46 PM
Referencing a named range based upon Range name entry in cell Barb Reinhardt Excel Worksheet Functions 14 June 20th 07 07:19 PM
Can A Named Range Be A Variable? Minitman[_2_] Excel Programming 7 February 25th 04 11:41 PM
Referencing Named Range in Other Sheet Dan E[_2_] Excel Programming 0 July 11th 03 04:22 PM


All times are GMT +1. The time now is 09:44 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"