Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default How to Loop and Read the Cell until the end of worksheet

Dear all,

Suppose I have three columns of Data. Now I want to read
the first column and third
column. How can I write VBA code to loop the first column and third
column till the end of the
worksheet.? Here are my questions: How to determine there is an end in
worksheet?
How to loop the first column and third column cell by cell. Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default How to Loop and Read the Cell until the end of worksheet

One way

For Each cell In Range("A1").CurrentRegion

If cell.Column = 1 Or cell.Column = 3 Then
'do stuff
End If
Next cell

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"hon123456" wrote in message
ups.com...
Dear all,

Suppose I have three columns of Data. Now I want to read
the first column and third
column. How can I write VBA code to loop the first column and third
column till the end of the
worksheet.? Here are my questions: How to determine there is an end in
worksheet?
How to loop the first column and third column cell by cell. Thanks.



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
read and check cells in loop Arne Hegefors Excel Programming 1 April 18th 07 04:48 PM
Worksheet loop won't loop L. Howard Kittle Excel Programming 4 March 17th 06 12:56 AM
having probelms getting my loop to terminate on an array value read from an empty cell mizcrab Excel Programming 3 November 30th 05 02:54 AM
"read only" cell in a given worksheet Colin2u Excel Discussion (Misc queries) 2 July 29th 05 04:33 PM
How? Macro to copy range to new worksheet, name new worksheet, loop Repoman Excel Programming 9 October 9th 03 01:45 PM


All times are GMT +1. The time now is 10:11 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"