LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default identifying the end of a data column

One common way is this

Sub stance()
Dim myrnge As Range
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Set myrange = Range("A1:A" & lastrow)
For Each c In myrange
'do somthing
Next
End Sub

Or another to loop down Column A

Sub stance1()
x = 1
Do
myvalue = Range("A" & x).Value
'do something
x = x + 1
Loop Until myvalue = ""
End Sub

Mike

"MJKelly" wrote:


If I want to loop through a column of data, I have usually stated the
range (A1:A10). How do I do this without stating the range, but
instead have the loop run in a given column until the first empty
cell?

kind regadrs,
Matt

 
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
Identifying the every nth document in a column boby Excel Discussion (Misc queries) 2 May 4th 09 10:33 PM
Identifying Last Column With Text stan Excel Discussion (Misc queries) 1 February 5th 09 02:58 PM
Identifying the row and column of a table value JHB Excel Discussion (Misc queries) 6 January 28th 09 10:17 PM
Identifying duplicate content in column excelstart[_3_] Excel Programming 3 January 9th 06 10:22 PM


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