+ Reply to Thread
Results 1 to 7 of 7

Running subroutines from Userforms

  1. #1
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Running subroutines from Userforms

    Hi, I'm having trouble getting my workbook to run code properly.

    I have a Userform that imports a range of data (using "Add details" and "Save and Close" buttons) into a worksheet called Monitor. Within this Monitor, this imported data is compared with another sheet and if any cells have changed, identified in column A, it automatically sends out an email using a subroutine located in ThisWorkbook. The email part works fine if I manually change the data in Monitor, but it doesn't send an email when the data is imported.

    I've tried getting it to run this subroutine from the "Save and Close" in the Userform but with no luck.

    This is the email code in ThisWorkbook:

    Please Login or Register  to view this content.

    And this is what I have in Monitor:

    Please Login or Register  to view this content.
    Last edited by aidan5800; 06-27-2018 at 10:48 AM.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running subroutines from Userforms

    Code tag post removed. Member complied with request
    Last edited by gmr4evr1; 06-27-2018 at 11:31 AM.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running subroutines from Userforms

    I believe that since the column you want to triggered is updated automatically, the Worksheet Change event will not trigger, it only fires upon manual entry. You would have to trigger it another way

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running subroutines from Userforms

    Did you try placing the following code at the beginning of the save and close routine?
    Please Login or Register  to view this content.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,289

    Re: Running subroutines from Userforms

    Rule 08: Cross-posting Without Telling Us

    Your post does not comply with Rule 8 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question. If you have fewer than 10 posts here, you will not be able to post a link, but you must still tell us where else you have asked the question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved 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-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    If you have less than 10 posts, do not try to copy and paste the link. Instead, type the link out in your thread.

    No further help to be offered, please, until the OP has complied with this request.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Re: Running subroutines from Userforms

    Apologies didn't realise. Have posted the same question at the following though have requested its removal:

    https://www.mrexcel.com/forum/excel-...ml#post5095231

  7. #7
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Re: Running subroutines from Userforms

    Hi, Ive tired that but it didn't work. I think I need to either run the subroutine in ThisWorkbook from the userform "Save and Close", or based on the result of a formula from the monitor sheet but Im not sure how to do either. The code for the userform is as follows:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBE Toolbox keeps popping up when running Userforms
    By AdLoki in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-17-2021, 05:50 AM
  2. [SOLVED] status update to show running subroutines
    By xi603 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-30-2017, 05:15 PM
  3. [SOLVED] Running subroutines
    By tjgrassi in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2014, 11:54 AM
  4. [SOLVED] UserForms not running
    By Jietoh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-02-2013, 08:25 AM
  5. [SOLVED] can't debug some subroutines in my project, locked subroutines
    By florin_excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-28-2012, 01:16 PM
  6. userforms and subroutines
    By stanigator in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-04-2007, 03:28 PM
  7. running subroutines concurrently
    By thomas 1950 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2007, 06:25 PM

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