+ Reply to Thread
Results 1 to 2 of 2

Validation code for macro to run

Hybrid View

  1. #1

    Validation code for macro to run

    Hi...the code below works fine, but how do I change it so that it
    doesn't look for a blank cell (""), but looks for specific text in a
    cell? There is an If formula in cell C269 so that if 2 figures balance
    then this cell displays "TRUE", otherwise it displays "FALSE".

    The code mustn't run if Cell C269 displays "FALSE".

    If [C269] = "" Then
    MsgBox "The figures don't balance!!"
    Exit Sub
    End If
    Range("E1:E48").Select
    Selection.Copy
    End Sub

    Thanks.

    Rob


  2. #2
    Paul B
    Guest

    Re: Validation code for macro to run

    Rob, try this,

    If [C269] = "False" Then
    MsgBox "The figures don't balance!!"
    Exit Sub
    End If
    Range("E1:E48").Select
    Selection.Copy
    End Sub


    --
    Paul B
    Always backup your data before trying something new
    Please post any response to the newsgroups so others can benefit from it
    Feedback on answers is always appreciated!
    Using Excel 2002 & 2003

    <[email protected]> wrote in message
    news:[email protected]...
    > Hi...the code below works fine, but how do I change it so that it
    > doesn't look for a blank cell (""), but looks for specific text in a
    > cell? There is an If formula in cell C269 so that if 2 figures balance
    > then this cell displays "TRUE", otherwise it displays "FALSE".
    >
    > The code mustn't run if Cell C269 displays "FALSE".
    >
    > If [C269] = "" Then
    > MsgBox "The figures don't balance!!"
    > Exit Sub
    > End If
    > Range("E1:E48").Select
    > Selection.Copy
    > End Sub
    >
    > Thanks.
    >
    > Rob
    >




+ 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