Results 1 to 4 of 4

VBA IF Statement to return MsgBox if True and Stop Macro

Threaded View

  1. #1
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, California
    MS-Off Ver
    Excel 2007
    Posts
    2

    VBA IF Statement to return MsgBox if True and Stop Macro

    Hello,

    I am trying to wrirte a simple IF statement in VBA code, but it has become more challenging than expected. I have a column (column D) within a work sheet called "custom cost sheet". Column D lists whether a cost is correct or not. I want to create a VBA code that will scroll through Column D in search for the word "incorrect cost", if the word exists I want a Msgbox to appear stating "cost error, fix cost and recalculate" and then stop the macro from continuing. I just want the Msgbox to appear for the first cell it finds containing "incorrect cost", not each cell. If the text is not found within the column, I want the macro to continue and finish running.

    Any help with this would be extremely appreciated.

    Thanks in advance!

    Rene
    Last edited by Forge463; 07-05-2012 at 08:00 PM. Reason: Changed Title

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