+ Reply to Thread
Results 1 to 2 of 2

VBA Command Button Query

  1. #1
    Registered User
    Join Date
    11-18-2010
    Location
    Newcastle Upon Tyne
    MS-Off Ver
    Excel 2007
    Posts
    2

    VBA Command Button Query

    Im fairly new to VBA so apologies for any ridiculous look script. Basically I was asked to create a room plan for the office i work in. I have done this using Excel 07 VBA. I have a userform with a button for each desk, when a button is clicked it gets the details from 6 different combo boxes and shows the details of that desk in a textbox.Each button is named the number of the desk i.e 1,2,3....upto 87.

    Everything works fine, although i have had to put the following code under each button_click function
    Please Login or Register  to view this content.
    so i have the above 87 times. Each time changing the list index so button 1 listindex = 0 button 2 = 1 etc.

    What i would like is the above code to be written once and the listindex changes according to what button is clicked. I have checked various forums/threads but cant find an answer

    Thanks in advance

    crosspost
    http://www.mrexcel.com/forum/showthr...86#post2516386
    Last edited by Airwilf; 11-18-2010 at 10:28 AM. Reason: add tags. add link

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA Command Button Query

    Hi and welcome.

    Unfortunately:

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

    Read this to understand why we ask you to do this

    You also didn't use code tags, but I've added those for you on this occasion as it's your first post. Please make sure to use them in future.

    Once you have added the links to your posts in other forums, we can set about your problem.
    Remember what the dormouse said
    Feed your head

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1