Results 1 to 3 of 3

Using Next inside an IF statement

Threaded View

  1. #1
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Using Next inside an IF statement

    I get an error if I try to move to the next value within a For statement within an IF. Here's my code
    Sub Replacing()
    
    Dim Cell As Range
    Dim SelectRng As Range
    
    Set SelectRng = Selection
    For Each Cell In SelectRng
    If IsError(Cell.Value) Then
    Next
    End If
    
    If Cell.Value > 35 Then Cell.Value = 35
    Next
    End Sub
    Thanks in advance.
    Last edited by ChemistB; 12-13-2010 at 11:25 AM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

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