+ Reply to Thread
Results 1 to 5 of 5

MsgBox based on one or multiple values

  1. #1
    Registered User
    Join Date
    02-04-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    41

    MsgBox based on one or multiple values

    Hi,

    I have a spreadsheet where there are multiple cells, that need to completed before being submitted. I have written the code so a MsgBox will pop up when submitted if the cells are empty, but it will pop up one for each cell separately. I would prefer that only one MsgBox would pop up, identifying which cells need to be completed but I am not sure how to combine them so only the empty cells are advised in the MsgBox.

    The Subs I have written are below:

    Please Login or Register  to view this content.
    Eventually, I will probably roll the above Subs into one (e.g. DocChk) and run it as part of the Submit code but I am still relatively inexperienced so trying to keep it simple.
    Any guidance here would be appreciated.

    Thanks,
    Chris

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: MsgBox based on one or multiple values

    try
    Please Login or Register  to view this content.
    Last edited by nigelog; 05-30-2019 at 12:28 PM.

  3. #3
    Registered User
    Join Date
    02-04-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    41

    Re: MsgBox based on one or multiple values

    Thank you nigelog, perfect solution.

    Just one question if I may, I understand the code you gave, with the exception of "If Len(str) > 0 Then"

    Can you briefly explain for me what this code does please?

    Thanks,
    Chris
    Last edited by ChrisMP; 05-30-2019 at 12:42 PM.

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286
    The variable str picks up text as it goes though the cells. If no message picked up it will be empty, 0 in length so message only needed if greater in length than 0.
    If that answers question please mark as solved.

  5. #5
    Registered User
    Join Date
    02-04-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    41

    Re: MsgBox based on one or multiple values

    Thank you, understand and am grateful for your help

+ 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. Replies: 5
    Last Post: 07-31-2018, 01:43 PM
  2. If (multiple values) and vlookup (based on answer to multiple values)
    By MaverickSemperFi in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-30-2018, 07:26 AM
  3. MsgBox to show multiple searched values of cells
    By abhijit2610 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2016, 08:26 AM
  4. Replies: 1
    Last Post: 10-01-2013, 02:41 AM
  5. Replies: 5
    Last Post: 09-25-2013, 12:31 AM
  6. Msgbox with message based on multiple variables / if statements?
    By adamsad1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-05-2013, 07:09 PM
  7. Vlookup macro based on 2 values returning msgbox
    By bd528 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-07-2010, 09:16 AM

Tags for this Thread

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