View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Loop thru used rows in column

I like to start at the bottom and look up to find that last used cell. It's
useful if the range could contain empty cells.



Dim myRng as range
dim myCell as range

with worksheets("Somesheetnamehere")
set myrng = .range("A4", .cells(.rows.count,"A").end(xlup))
end with

for each mycell in myrng.cells
msgbox mycell.address 'or whatever you want to do
next mycell


Gsurfdude wrote:

Hello,

I am fairly new to Excel VBA and I need to know how to loop through used
rows in a one column. In logic

for each row in column A starting @ A4 to A whatever

So I need to return values in A4-A whatever is used. I hope that makes sense

Thanks!


--

Dave Peterson