Hi all
I have a question on select case statements, before I embark on this particular useful function. I am working in excel 2010.
Can VBA cope with what I would descibe as a dynamic select case statement ?
To try and explian, I have a series of arrays that are dimensioned according to a number of filled cells on a reference sheet. It could have 5 to 10 elements (in 1 dimension only)
If there are 5 elements then there will be 5 select case lines, if 7 elements in the array then 7 select case line, etc.
This is part of a dynamic analysis tool where the user will input the data limits within which the data is to be analysed eg
the user will have input 100, 500, and 1000 in a table, however if they had also input 750 in the table and extra line would be used, therefore the code will now look like:
any help or guidance would be greatly appreciated.
Simon
I have a question on select case statements, before I embark on this particular useful function. I am working in excel 2010.
Can VBA cope with what I would descibe as a dynamic select case statement ?
To try and explian, I have a series of arrays that are dimensioned according to a number of filled cells on a reference sheet. It could have 5 to 10 elements (in 1 dimension only)
If there are 5 elements then there will be 5 select case lines, if 7 elements in the array then 7 select case line, etc.
This is part of a dynamic analysis tool where the user will input the data limits within which the data is to be analysed eg
Code:
select case value
case is <100
do something
case 101 to 500
do something
case 500 to 1000
do something
end select
the user will have input 100, 500, and 1000 in a table, however if they had also input 750 in the table and extra line would be used, therefore the code will now look like:
Code:
select case value
case is <100
do something
case 101 to 500
do something
case 500 to 750
do somthing
case 750 to 1000
do something
end select
any help or guidance would be greatly appreciated.
Simon