ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro selecting rows. (https://www.excelbanter.com/excel-programming/312680-macro-selecting-rows.html)

TOM

Macro selecting rows.
 
Hi All

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

Thanks in advance.

Frank Kabel

Macro selecting rows.
 
Hi
what are you trying to do with this selection?

--
Regards
Frank Kabel
Frankfurt, Germany

"Tom" schrieb im Newsbeitrag
...
Hi All

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

Thanks in advance.



TOM

Macro selecting rows.
 
actually every other row!

Thanks.
-----Original Message-----
Hi All

How can i creat a macro that will select every other

colum
in the worksheet?

Thanks in advance.
.


Tom Ogilvy

Macro selecting rows.
 
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

--
Regards,
Tom Ogilvy



"Tom" wrote in message
...
actually every other row!

Thanks.
-----Original Message-----
Hi All

How can i creat a macro that will select every other

colum
in the worksheet?

Thanks in advance.
.




TOM

Macro selecting rows.
 
Hey Frank

I want to shade them! I want to shade every other row.

Thanks.
-----Original Message-----
Hi
what are you trying to do with this selection?

--
Regards
Frank Kabel
Frankfurt, Germany

"Tom" schrieb im

Newsbeitrag
...
Hi All

How can i creat a macro that will select every other

colum
in the worksheet?

Thanks in advance.


.


Frank Kabel

Macro selecting rows.
 
Hi
for this I would use conditional formating. See:
http://www.cpearson.com/excel/banding.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Tom" schrieb im Newsbeitrag
...
Hey Frank

I want to shade them! I want to shade every other row.

Thanks.
-----Original Message-----
Hi
what are you trying to do with this selection?

--
Regards
Frank Kabel
Frankfurt, Germany

"Tom" schrieb im

Newsbeitrag
...
Hi All

How can i creat a macro that will select every other

colum
in the worksheet?

Thanks in advance.


.




All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com