+ Reply to Thread
Results 1 to 4 of 4

Run the Macro if cell value is YES, else show error message.

  1. #1
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Run the Macro if cell value is YES, else show error message.

    Dear Friends,

    I have a macro which should run only if the value "YES" in "B10". Else the message should say that "NOT POSSIBLE".

    Thanks in advance.

    acsishere.
    Last edited by VBA Noob; 07-13-2008 at 03:04 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Right click sheet tab > select view code > paste in the below

    Change Call Macro1 to your macro name

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    Thanks for your quick response.

    I have a few doubts:

    1) How to modify the code to run within the code itself. For ex, if I am to open a sheet through macro, then my code is:

    Please Login or Register  to view this content.
    Similarly, I am to open the sheets through these kind of macros (buttons are in a single page). Because the users have to be restricted in activating these sheets.

    2) The above doubt arises because your code is based on worksheet_change. How to apply this code if I have 10-15 macros to be called (but buttons are in a same sheet).

    3) Can you please tell me if I named the range (the cell "B10" is named as "YES1"), what modification is to be done.

    Thanks for your support.

    acsishere

  4. #4
    Forum Contributor
    Join Date
    10-01-2007
    Posts
    101
    im a noob so im not sure if this is what youre looking for. yessub could be any sub, i just made a simple one. and of course this example assumes that if b10 isnt yes then its blank.
    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)

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