Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default formula construction II

hi all,

apparently INDIRECT doesn't work with dynamically defined ranges

i have 2 options - i can either redefine the ranges every time i insert a
row in this worksheet (re-defining 24 ranges each time)

or

i could write a function that would take as arguments 2 strings, concatenate
them, and then return the correct range.

any thoughts on the practicality of option 2?

Public Function fixRange(loc As Range, app As String) As Range
fixRange = Range((loc & app)).Address
End Function

doesn't seem to work - although in the debugger the range is determined
correctly.

J
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default formula construction II

set fixRange = Range((loc & app))

works

J

"Gixxer_J_97" wrote:

hi all,

apparently INDIRECT doesn't work with dynamically defined ranges

i have 2 options - i can either redefine the ranges every time i insert a
row in this worksheet (re-defining 24 ranges each time)

or

i could write a function that would take as arguments 2 strings, concatenate
them, and then return the correct range.

any thoughts on the practicality of option 2?

Public Function fixRange(loc As Range, app As String) As Range
fixRange = Range((loc & app)).Address
End Function

doesn't seem to work - although in the debugger the range is determined
correctly.

J

  #3   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default formula construction II

Sounds like you answered your own question.

I don't think the address thing worked because you've stated the function
will return a range, but you are assigning a range address to your function,
which is a string.


"Gixxer_J_97" wrote:

hi all,

apparently INDIRECT doesn't work with dynamically defined ranges

i have 2 options - i can either redefine the ranges every time i insert a
row in this worksheet (re-defining 24 ranges each time)

or

i could write a function that would take as arguments 2 strings, concatenate
them, and then return the correct range.

any thoughts on the practicality of option 2?

Public Function fixRange(loc As Range, app As String) As Range
fixRange = Range((loc & app)).Address
End Function

doesn't seem to work - although in the debugger the range is determined
correctly.

J

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
I am looking for formula to calculate escalation on construction Ronnie Excel Discussion (Misc queries) 2 April 26th 23 07:44 PM
formula construction Robert-the-Bruce New Users to Excel 7 June 9th 07 08:12 PM
formula construction Old Red One Excel Discussion (Misc queries) 8 February 10th 06 01:02 PM
formula construction w/ vba Gixxer_J_97[_2_] Excel Programming 5 June 7th 05 02:13 PM
formula construction Gixxer_J_97[_2_] Excel Programming 2 February 15th 05 02:43 PM


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