+ Reply to Thread
Results 1 to 4 of 4

Check if button 1 or button 2 was used

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    Almere
    MS-Off Ver
    Excel 2003
    Posts
    48

    Check if button 1 or button 2 was used

    I've created a sheet which has several buttons on it and each button shows a userform with some inputboxes.
    this works fine but now I'm trying to reduce the amount of userforms I have.
    For Example, Button 1 shows userform1_Incoming and button 2 calls userform1_Outgoing. They are both the same with the only difference between them is that userform1_Incoming will write the word IN in a specific cell and userform1_Outgoing writes the word OUT in this cell.
    Is it possible to use something like X="IN" and Y="OUT" inside the module and when userform1 is used, I can use the X or Y variable to write the specific cell ????
    I hope I explained it clearly

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Check if button 1 or button 2 was used

    Assuming your buttons are form controls you can use Application.Caller to determine which button was pressed.

    Not sure, from your description, why you even need a userform.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    08-16-2012
    Location
    Almere
    MS-Off Ver
    Excel 2003
    Posts
    48

    Re: Check if button 1 or button 2 was used

    Andy,

    I will look at the application.caller command to see if this is what I need.
    Userform is neccessary because there are some options the user needs to input besides the predefined words IN and OUT

  4. #4
    Registered User
    Join Date
    08-16-2012
    Location
    Almere
    MS-Off Ver
    Excel 2003
    Posts
    48

    Re: Check if button 1 or button 2 was used

    I looked at application.caller and found some ways of use...
    It's not quite the way it should be but I'm getting further each day..
    Last edited by minifreak; 08-23-2012 at 04:11 AM.

+ 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