+ Reply to Thread
Results 1 to 4 of 4

If statement in macros

  1. #1
    Registered User
    Join Date
    12-20-2013
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2013
    Posts
    53

    If statement in macros

    Hello.
    In my macro code i am trying to have a message box pop up when either cells A1 or A4 or B12 is populated. (This is an example, it's really a lot more cells than that and they are scattered throughout the sheet and not in a range).
    So if either A1 is the only cell populated or A4 is the only cell populated or B12 is the only cell populated then the code should work as well as if all cells together are populated. If none of the cells are populated then the code should exit sub.

    Thanks in advance

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: If statement in macros

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    12-20-2013
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2013
    Posts
    53

    Re: If statement in macros

    Thank you. I learned something new

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: If statement in macros

    You're welcome. Thanks for the rep.

+ 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. [SOLVED] IF, THEN, ELSE statement to run macros
    By will.girling in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-19-2013, 12:06 PM
  2. Macros to input formaulas into a lot of cells. Formula has an IF statement
    By stylecrazy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2013, 04:22 PM
  3. Macros If Then Statement
    By bapella in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2012, 09:37 AM
  4. Macros: Data cleaning macros not producing expected outputes.
    By bertlogdi1 in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 06-17-2011, 06:52 AM
  5. [SOLVED] If then statement causing value issues in Macros
    By ssciarrino in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2005, 02:10 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