select only certain cells in a columns
Dim rng as Range, cell as Range, rng1 as Range
set rng = Range(cells(1,"C"),Cells(rows.count,"C").End(xlup) )
set rng1 = nothing
for each cell in rng
if cell.value = "True" then
if rng1 is nothing then
set rng1 = cell
else
set rng1 = union(rng1,cell)
end if
Next
Next
if not rng1 is nothing then
rng1.entirerow.copy Destination:=worksheets("Sheet2").Range("A1")
rng1.EntireRow.delete
End if
code is untested.
--
regards,
Tom Ogilvy
"desperate" wrote in message
...
How would I write an if statement to select all the cells in a column that
are marked true, and then move those true rows somewhere else?
|