Multiple selection criteria using named ranges - can't get it
Posted by Darren S on August 17, 2001 2:02 AM
In VBA I am trying to name a range of cells (AllTransactionDates & AllTransactionAmounts) that changes length on a daily basis. I intend to use this named range as part of a multiple criteria sum.
When the range is named manually calculation works correctly.
As the range is added to on a daily basis my plan was to delete the named range in VBA and using
rename the range. My attempts have not worked. I am able to get the range named however the calculation does not seem to work. I suspect it has something to do with the name range wanting to using R1C1 type address and the selection method returns a cell address.
I found the following code that I thought might work, however I seem to have disabled the use of a reserved word "Address" in my project somehow. I was planning on returning the result of the following line to a variable to assist in the naming.
Address(2, 1, 1, False, "All Transactions")
however when I type Address the computer changes it to address, I at one stage used this word as a variable but it no longer exists now.
Is there an answer. The easiest way as I see it is if a named range can be created in VBA based upon the last cell used in a row.
Assistance is appreciated. I am going nuts.