eti3nne
MIS
- Feb 5, 2004
- 102
If I want to refer to a button on a particular sheet from a module, how do I preface a:-
If CommandButton2.Caption = "Hello" then ...statement?
1) If sheet name is say Sheet1
2) if sheet name is say a variable like WeekEndingDate
3) or do i use say ... Sheet33(WeekEnding12Jul2009).. (this is how it appears in the code lists.)
The reason I am asking is because if I put the refrence on the same code sheet as the button, 'CommandButton2.Caption' statement runs Ok, but if I put this code in a module and call the code, the statement seems to be being ignored or is looked for elsewhere (or something!?)
Thanks for looking.
If CommandButton2.Caption = "Hello" then ...statement?
1) If sheet name is say Sheet1
2) if sheet name is say a variable like WeekEndingDate
3) or do i use say ... Sheet33(WeekEnding12Jul2009).. (this is how it appears in the code lists.)
The reason I am asking is because if I put the refrence on the same code sheet as the button, 'CommandButton2.Caption' statement runs Ok, but if I put this code in a module and call the code, the statement seems to be being ignored or is looked for elsewhere (or something!?)
Thanks for looking.