A
aah-boy
Hi all,
Just want to pick brains here for better ways to achive what I'm
doing, here goes...
I have some code which scans a worksheet for text strings, when it
finds one (using a big case statement) it puts the value of an
adjacent cell into a public variable. At the end of the scan, it
checks each variable (using a big 'if' statement) to see if there is a
value in it - if there is I prints it out.
My problem is this...
Every time the user adds a new text label (and value), I have to add
1) a new public variable 2) a new 'case' to trap it and 3) another
'if' to print it out.
Surely there must be a better way of doing this? Say by just adding
the text label to search for, the variable to put it into and the
offset cell that the value is in - to some kind of big abject. Rather
than using the 'case' and 'if' way that I am using.
Ideally it would be nice if it could add its own variables when it
finds new strings.
Any thoughts?
Thanks,
Dave
Just want to pick brains here for better ways to achive what I'm
doing, here goes...
I have some code which scans a worksheet for text strings, when it
finds one (using a big case statement) it puts the value of an
adjacent cell into a public variable. At the end of the scan, it
checks each variable (using a big 'if' statement) to see if there is a
value in it - if there is I prints it out.
My problem is this...
Every time the user adds a new text label (and value), I have to add
1) a new public variable 2) a new 'case' to trap it and 3) another
'if' to print it out.
Surely there must be a better way of doing this? Say by just adding
the text label to search for, the variable to put it into and the
offset cell that the value is in - to some kind of big abject. Rather
than using the 'case' and 'if' way that I am using.
Ideally it would be nice if it could add its own variables when it
finds new strings.
Any thoughts?
Thanks,
Dave