Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
TOM TOM is offline
external usenet poster
 
Posts: 47
Default Macro selecting rows.

Hi All

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

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
TOM TOM is offline
external usenet poster
 
Posts: 47
Default 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.
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.
.



  #5   Report Post  
Posted to microsoft.public.excel.programming
TOM TOM is offline
external usenet poster
 
Posts: 47
Default 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.


.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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.


.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
after selecting 50 rows of a column i can't reference the cells in the rows Bob Salzer New Users to Excel 2 July 21st 06 10:29 PM
Macro selecting blank rows/columns floss Excel Programming 1 April 27th 04 10:25 PM
selecting multiple rows within a Macro Tom Ogilvy Excel Programming 0 August 30th 03 01:08 AM
selecting multiple rows within a Macro Eric Dreshfield Excel Programming 0 August 29th 03 09:14 PM
selecting multiple rows within a Macro Jean-Paul Viel Excel Programming 0 August 29th 03 09:04 PM


All times are GMT +1. The time now is 07:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"