Results 1 to 12 of 12

How to Stop & Exit Sub if cell value > 1 was found

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    How to Stop & Exit Sub if cell value > 1 was found

    Hello All,
    Any one can help me how to stop and exit sub if cells value > 1 was found? If not continous macro

    Sub Testing()

    Dim lastrow As Long
    Dim iCell As Long
    lastrow = Range("B" & Rows.Count).End(xlUp).Row
    For iCell = lastrow To 2 Step -1
    If Range("B" & iCell) > 1 Then
    With Range("B" & iCell)
    .EntireRow.RowHeight = 38
    End With
    End If
    Next iCell

    ''''''''I want to stop and Exit Sub right away if any cell value > 1 was found
    ''''''''If there's no value > 1 then

    Else

    UserForm1.Show

    End Sub
    Regards,
    tt3
    Last edited by tuongtu3; 02-20-2013 at 12:54 AM. Reason: Solved

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