7 replies
by dklippert
Try this macro. Create a blank column for a "Flag". When you run the macro, you will be asked for an interval and then an X will be placed in the Flag column at every Nth row. This can then be sorted or filtered.
Sub Selectnth()
'start at the top of the second column
'it is assumed the second column has data
'first column is the flag column.
intnth = InputBox("Enter the interval value")
'repeat until on a blank cell
Do Until ActiveCell.Value = ""
x = 1
For x = 1 To intnth
ActiveCell.Offset(1, 0).Range("A1").Select
Next
ActiveCell.Offset(0, -1).Range("A1").Select
ActiveCell.Value = "X"
ActiveCell.Offset(0, 1).Range("A1").Select
'move down a row
ActiveCell.Offset(1, 0).Range("A1").Select
Loop
End Sub
by tracyp
by tracyp
by tracyp
by dklippert
There must be an empty column to the left of the data.
The macro assumes a label/field name in the first cell.
Select the first cell to start.
Step into, of course, is F8.
Works for me when run as is or in Debug mode.
by tracyp
by tracyp
This discussion is closed to new replies.
Trending Software posts
Sort by Trending