"Ray" <ra*****@excite.com> wrote in message
news:20**************************@posting.google.c om...
Hello all. I'm certainly missing something here and perhaps
it could be explained. Why so much about which button was
pressed? Can't you just put the code you want behind each
of the buttons separately? Example:
Private Sub Button1_Click()
link = PerfArray(iCtr).strFund_Name & ".Doc"
End Sub
Private Sub Button2_Click()
link = PerfArray(iCtr).strTicker & ".Doc"
End Sub
This seems to work for me and seems a bit simplier
to code.
Regards,
Ray
Of course when the code is that simple, it doesn't make much difference.
But what if the code was supposed to do a million and one complicated
calculations, then create an Excel spreadsheet and save it in a location
specific to which button was pressed - and this time there were 5 different
buttons.
Would you write all of the code and copy it 5 times altering a small part of
the code specific to each button? What then when you adjust your code, each
time keep 5 separate versions updated? By writing the bulk of the code only
once you save duplication with all the bug-risks that introduces and make it
far easier to read and maintain.
Fletcher