Macro selecting rows.

T

Tom

Hi All

How can i creat a macro that will select every other colum
in the worksheet?

Thanks in advance.
 
T

Tom Ogilvy

Dim rng as Range, cell as Range
for each cell in UsedRange.Columns(1).Cells
if cell.row mod 2 = 0 then
if rng is nothing
set rng = cell
else
set rng = union(rng,cell)
end if
end if
Next
if not rng is nothing then
rng.EntireRow.Select
End if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top