+ Reply to Thread
Results 1 to 4 of 4

Display msgbox if two cells in range are not empty

  1. #1
    Registered User
    Join Date
    07-27-2013
    Location
    Peru
    MS-Off Ver
    Excel 2003
    Posts
    24

    Display msgbox if two cells in range are not empty

    Hello

    I would like my vba code to display a msbox in this case:

    In columns range A and B
    if cell A1 and cell B1 are both not empty then msgbox "You can insert data in only one cell"

    This must apply in any cell ranges in the same row of columns A and B, for example A5 and B5, or A100 and B100

    Regards
    Claudio

  2. #2
    Registered User
    Join Date
    01-25-2014
    Location
    Hong Kong
    MS-Off Ver
    Excel 2013/2010/2007/2003, Mac Excel 2011
    Posts
    8

    Re: Display msgbox if two cells in range are not empty

    Try this code:


    Please Login or Register  to view this content.

    Regards,
    Edwin Tam
    Last edited by 6StringJazzer; 02-13-2014 at 08:06 AM. Reason: commercial link removed

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Display msgbox if two cells in range are not empty

    Hi Claudio,
    try it
    Please Login or Register  to view this content.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Display msgbox if two cells in range are not empty

    Copy the below code and do right click on sheet tab and select view code and paste it.

    Close the VBA window (Alt+Q to close VBA window) and return to that sheet and check.

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

+ 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. MACRO to empty a range of cells based on whether specified cell is empty
    By TBJV in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2013, 10:35 PM
  2. highlit duplicated cells and display the row number and cell value in msgbox
    By kmakjop in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-07-2013, 04:26 PM
  3. [SOLVED] Display Range of Values with MsgBox
    By akynyemi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-17-2013, 03:40 AM
  4. MsgBox to display Cells and verify/update
    By Ron1121 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-16-2010, 01:51 AM
  5. display filled vs empty cells in a range
    By dr mint in forum Excel General
    Replies: 6
    Last Post: 08-04-2009, 10:38 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