Does anyone know how to selcect non adjacent rows depending what is in the first cell of that row.
For example:
if a1=0 then select the entire row
then if a2 also equals 0 then select that row also.
then if a3 does not equal 0 don't select that row, etc.
What I was trying to do was create a string with all the row addresses separated by a comma but it won't let me use the string as a range.
Here's what I have so far.
Dim cell
Dim strCollect As String
stringcollect = Empty
For Each cell In Range("a1:a1000"
cell.Activate
If ActiveCell = 1 Then
If strCollect = Empty Then
strCollect = ActiveCell.EntireRow.Address
Else
strCollect = strCollect & "," & ActiveCell.EntireRow.Address
End If
End If
Next
Range(strCollect).Activate
Any ideas would be appreciated.
For example:
if a1=0 then select the entire row
then if a2 also equals 0 then select that row also.
then if a3 does not equal 0 don't select that row, etc.
What I was trying to do was create a string with all the row addresses separated by a comma but it won't let me use the string as a range.
Here's what I have so far.
Dim cell
Dim strCollect As String
stringcollect = Empty
For Each cell In Range("a1:a1000"
cell.Activate
If ActiveCell = 1 Then
If strCollect = Empty Then
strCollect = ActiveCell.EntireRow.Address
Else
strCollect = strCollect & "," & ActiveCell.EntireRow.Address
End If
End If
Next
Range(strCollect).Activate
Any ideas would be appreciated.