+ Reply to Thread
Results 1 to 6 of 6

Excel - VBA - 2 Joined macros not working - MsgBox issue - Please help!

  1. #1
    Registered User
    Join Date
    02-08-2016
    Location
    Scotland
    MS-Off Ver
    2010
    Posts
    3

    Excel - VBA - 2 Joined macros not working - MsgBox issue - Please help!

    Hi,

    Relatively new to VBA and I'm looking for some help. This will probably be simple but I cant seem to get this to work.

    Looking to join 2 macros together (I've checked them on separate spreadsheets and they work separately but not together).
    First macro deletes rows depending on criteria selected from a drop down list.
    Second macro shows an error message box depending on criteria within a separate cell. I would like this to be cell C19 however C19 already has a formula in it. I would like the result of the formula within C19 (HIGH/MEDIUM/LOW) to trigger the error message box - is this possible?
    If not, then I can use cells C29, C32 and C35. My sheet is called "REPORT".

    My code so far:

    Please Login or Register  to view this content.
    Any help would be greatly appreciated!
    thanks

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,879

    Re: Excel - VBA - 2 Joined macros not working - MsgBox issue - Please help!

    1) it is wise not to use ambiguous names for your procedures MsbBox is already standard proc, so better name it MyMsgBox or whatever.

    2) you can call one procedure within another. for instance:

    Please Login or Register  to view this content.
    Moreover - it seems that all your code sits in a worksheet module. I'd probably move second procedure to standard module (of course without Me. in such case).
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    02-08-2016
    Location
    Scotland
    MS-Off Ver
    2010
    Posts
    3

    Re: Excel - VBA - 2 Joined macros not working - MsgBox issue - Please help!

    Thanks for your reply.
    I've kept it in a worksheet module to avoid having all separate macros .. whats the difference between the standard module?
    I've added the code above with the MyMsgBox but it still isn't working, any ideas? Can you also help in telling me whether I can use cell C19 for this message box even though it already has a formula in it?

    Thanks

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,879

    Re: Excel - VBA - 2 Joined macros not working - MsgBox issue - Please help!

    But in the code you do not refer to C19 but to D3!

  5. #5
    Registered User
    Join Date
    02-08-2016
    Location
    Scotland
    MS-Off Ver
    2010
    Posts
    3
    Quote Originally Posted by Kaper View Post
    But in the code you do not refer to C19 but to D3!
    Ah sorry!! Copying and pasting glitch. D3 should be C19.

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,879

    Re: Excel - VBA - 2 Joined macros not working - MsgBox issue - Please help!

    Is it working as expected now?

+ 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. 2003 VBA MsgBox Issue
    By Thomasdaddy1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-11-2012, 12:41 PM
  2. Replies: 1
    Last Post: 11-20-2012, 06:54 AM
  3. [SOLVED] MsgBox Issue
    By mkachwee in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-11-2012, 08:28 AM
  4. Issue MsgBox for undefined value
    By artkingjw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2012, 11:49 PM
  5. excel macros not working
    By TLIPL in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-18-2011, 03:34 AM
  6. some macros not working on 2003 excel
    By jarssonn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2010, 06:06 AM
  7. [SOLVED] HELP : Excel 4 macros not working any more
    By Keske Saram in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-05-2005, 10:05 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