macleanb
06-19-2006, 05:43 AM
Hi
Long time no see - and as you might have guessed I am in trouble!
I am creating a "P&L explain" workbook that presents a top level summary of P&L and then allows the user to drill down into each row. Each row is linked to a sepearate worksheet.
I would dearly like to structure my code so that each subsiduary worksheet exposes a similar set of methods/properties which enable me to access/control them (like an interface).
At present I have individually named subs like so:
Factor1_Refresh
Factor2_Refresh
Factor3_Refresh/Factor3_Display...
and so on. What I would like to do is more along the lines of:
Worksheets("Factor1").Refresh
Worksheets("Factor2").Refresh
Worksheets("Factor3").Refresh
Now the important part is this would then allow me to substitute "FactorX" with a variable, so that I could run the same functions/methods against an object that I reference at runtime.
Anyone got any good ideas (or am I missing something obvious)
Many, many thanks
Ben
Long time no see - and as you might have guessed I am in trouble!
I am creating a "P&L explain" workbook that presents a top level summary of P&L and then allows the user to drill down into each row. Each row is linked to a sepearate worksheet.
I would dearly like to structure my code so that each subsiduary worksheet exposes a similar set of methods/properties which enable me to access/control them (like an interface).
At present I have individually named subs like so:
Factor1_Refresh
Factor2_Refresh
Factor3_Refresh/Factor3_Display...
and so on. What I would like to do is more along the lines of:
Worksheets("Factor1").Refresh
Worksheets("Factor2").Refresh
Worksheets("Factor3").Refresh
Now the important part is this would then allow me to substitute "FactorX" with a variable, so that I could run the same functions/methods against an object that I reference at runtime.
Anyone got any good ideas (or am I missing something obvious)
Many, many thanks
Ben