+ Reply to Thread
Results 1 to 9 of 9

If Not ActiveSheet.Range("A1").Value Like "apple" Then MsgBox "Error"

  1. #1
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    If Not ActiveSheet.Range("A1").Value Like "apple" Then MsgBox "Error"

    Greetings,
    Following code is okey.
    Please Login or Register  to view this content.
    I need a code like following.
    Red line needs corrected.
    Please Login or Register  to view this content.
    Regards
    Sub DontForgetThese()
         If Your thread includes any code Then Please use code tags...
         If Your thread has been solved Then Please mark as solved...
         If Anybody has helped to you Then Please add reputation...
    End Sub

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: If Not ActiveSheet.Range("A1").Value Like "apple" Then MsgBox "Error"

    Herry

    Add Stop after Then.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: If Not ActiveSheet.Range("A1").Value Like "apple" Then MsgBox "Error"

    Hi Norie,
    I want to see error line on vbe editor.
    I have been using following macro for this but I believe that better one exist.
    Because following macro is not working sometimes.
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: If Not ActiveSheet.Range("A1").Value Like "apple" Then MsgBox "Error"

    Herry

    Did you try what I suggested?

  5. #5
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: If Not ActiveSheet.Range("A1").Value Like "apple" Then MsgBox "Error"

    I tried following.
    Code runs non-stop
    Please Login or Register  to view this content.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: If Not ActiveSheet.Range("A1").Value Like "apple" Then MsgBox "Error"

    Strange because when I run it the code stops on Stop.

    What value do you have in A1 of the active sheet?

  7. #7
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: If Not ActiveSheet.Range("A1").Value Like "apple" Then MsgBox "Error"

    Please check enclosed file.
    Attached Files Attached Files

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: If Not ActiveSheet.Range("A1").Value Like "apple" Then MsgBox "Error"

    Herry

    When I run Macro3 code execution stops on Stop which is highlighted.

  9. #9
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: If Not ActiveSheet.Range("A1").Value Like "apple" Then MsgBox "Error"

    Hi Norie,
    I am so sorry.
    My mistake.
    Because I was testing pressing F8, F8, F8...

+ 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. Replies: 5
    Last Post: 01-23-2014, 11:02 AM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 AM
  5. use variable in Workbooks("book1").Worksheets("sheet1").Range("a1"
    By Luc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-28-2005, 04:05 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