• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 296
  • Last Modified:

Excel: Next Iteration with VBA

Is there any way to skip an iteration in For.. Next Iteration ?

My Script is something like this :
 For i = 2 To TotalRows
            If Selection.Offset(i - 1, -7).Value = "" Then
                Next i
            End If
            [commands goes here]
Next i

Open in new window


so basically i would like to check a value (in this case empty cell), if its true than skip the iteration to next value
0
veematics
Asked:
veematics
  • 2
2 Solutions
 
VipulKadiaCommented:
You can implement as follows :
For i = 2 To TotalRows
            If Selection.Offset(i - 1, -7).Value <> "" Then
                  'Write you code here
            End If
Next i
0
 
VipulKadiaCommented:
So in IF condition, I have converted '=' sign to '<>' sign.
0
 
aikimarkCommented:
I wrote an article on how to do this:
http://www.experts-exchange.com/A_2755.html
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now