Results 1 to 4 of 4

Thread: Return value from Array

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    178
    Hi,

    Does anyone know how I can create an array of command buttons and then write code so that when a button is pressed an index value or some parameter is passed back to the procedure so that I know which button is pressed. I know it is a simple problem its just my head isn't functioning this morning !!

    Thanks for any help
    Steve

  2. #2
    Lively Member
    Join Date
    Jun 2000
    Location
    Belgium
    Posts
    77
    As you say it, iIt's simple.
    1 - create a command buton
    2 - rename it as you want
    3 - copy it
    4 - paste it
    5 - answer yes at the question to make a control array

    All the event associate with the button have now a paramater Index.
    KWell

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    178
    DOH !!! Thanks for that, Its just come back to me....

    Cheers

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    178
    Sorry, I require more info...

    I totally agree using VB, but I am trying to create an array in VB running behind Excel. Unfortunately you can't just change the names to the same in VBA.

    So my question is again... How do I "create" IN CODE an array to hold command buttons (I am not sure whether to define a control or object) which I can then write code such as

    If my array is called Card_buttons

    Private Sub Card_buttons_click(Index as Integer)

    Sheet(Index).select
    (or something similar)

    End sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width