Command Button question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Greetings

I'm fairly new at XL programming and I need a bit of help.

I have a worksheet that contains, among other things, 5 command Buttons.

Part 1: The 40+ lines of code in each button is identical, except for
some range references. ( eg cmdA, cmdB ...etc refer to Range(D5:E25),
Range(J5:K25) ...etc). Can someone suggest how I can only enter the code
once to save space and have each button run the code with its own
appropriate ranges.

Part 2: There are eventually going to be 24 worksheets like the one
above, each having these same 5 buttons. On each worksheet, cmdA does the
exactly same thing. (same for cmdB, etc). Ideally, I'd like the code to be
usable by ALL buttons (24x5=120) in the workbook. I'm not sure how to
proceed.

Thank you very much for any help
Giselle


.



Relevant Pages

  • Re: user interaction to select a sheet
    ... In my specific situation, I think programming it ... to get the worksheet that owns that range: ... on error goto 0 ... I would like the user to be able to click on a cell in a sheet to tell the ...
    (microsoft.public.excel.programming)
  • Re: explanation of codes in Visual Basic when creating User form
    ... For example, looking up "Dim" will give you the syntax of Dim with its minimum and optional parts, and a few examples. ... means you defined a variable named "ws" as a Worksheet. ... If you have any background in programming -- and in particular object-oriented programming -- you can stumble your way through most Excel programming just by recording Macros and looking at the resulting code, supplmented with a healthy dose of the help files. ...
    (microsoft.public.excel.newusers)
  • Re: explanation of codes in Visual Basic when creating User form
    ... most of the terms is available in the help files within the Visual Basic ... looking up "Dim" will give you the syntax of Dim with ... means you defined a variable named "ws" as a Worksheet. ... If you have any background in programming -- and in particular ...
    (microsoft.public.excel.newusers)
  • Re: lookup stock symbol on worksheet and return summary data
    ... Filemaker Pro, I believe, is a program for the Macintosh that also allows ... professional developer and almost always involves complex programming. ... worksheet, and have information from that worksheet returned, ... He has this summary data on one worksheet (but with MUCH more data ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Outlining in Protected Sheet - Attention DP
    ... Dave, you explain even technical stuff very well - THANK YOU!!!! ... programming stuff coz that is how I am getting stuck, ... > ..enableoutlining enables the outlining feature. ... This code doesn't go behind a worksheet or behind ThisWorkbook. ...
    (microsoft.public.excel.misc)