What is the best way to select every third cell in column c starting with cell C5
Select Every Nth Cell In Column Range
-
-
-
Re: Select Every 3 Cell
Code
Display MoreSub SelectEveryNthCell() Dim rRange As Range Dim rEveryNth As Range Dim lRow As Long With Sheet1 Set rRange = .Range("C5", .Cells(.Rows.Count, "C").End(xlUp)) End With For lRow = 1 To rRange.Rows.Count Step 3 If lRow = 1 Then Set rEveryNth = rRange(lRow, 1) Else Set rEveryNth = Union(rRange(lRow, 1), rEveryNth) End If Next lRow Application.Goto rEveryNth End Sub
-
Re: Select Every Nth Cell In Column Range
thanks for the quick reply and help however -
unless i am doing something wrong its like it can only run for some many lines - like it can only handle doing this 100 rows or somewhere around there? any thoughts?
thank
-
Re: Select Every Nth Cell In Column Range
The subroutine that Dave wrote is designed to highlight cells up to the last non-blank cell in column C. If you want it to loop through all cells in column C, just remove the ".End(xlUp))".
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!