I'm trying to select a range of cells based on the condition in a preceeding column.
For example if [L12] = 1 then select cells [N12:Q12]. This initial part I have no problem with but looping through a range of L cells raises I'm having trouble with. This is my current code
The problem I'm having now is that it correctly identifies the 1s in column L but when it comes to a row with a one after a row with a 0 to select it also selects all of the intermediate cells as well.
the code Basically does a SHIFT+click when i want a CTRL+Click
Thanks!
For example if [L12] = 1 then select cells [N12:Q12]. This initial part I have no problem with but looping through a range of L cells raises I'm having trouble with. This is my current code
Code:
Dim k as integer
For k = 12 To 19
If Cells(k, "L").Value = 1 Then
Range(Cells(k, "N"), Cells(14, "Q")).Select
End If
Next k
The problem I'm having now is that it correctly identifies the 1s in column L but when it comes to a row with a one after a row with a 0 to select it also selects all of the intermediate cells as well.
the code Basically does a SHIFT+click when i want a CTRL+Click
Thanks!