You must first define what consitutes the "end" of the worksheet. If
you have data in column A and you want to loop through column A until
a blank cell is encountered, use something like
Dim R As Range
Set R = Worksheets("Sheet1").Range("A1")
Do Until R.Value = vbNullString
' do something with R
Set R = R(2, 1)
Loop
Or, if you can define one column whose last non-blank cell indicates
the end of the worksheet, you can use something like
Dim WS As Worksheet
Dim Col As String
Dim LastRow As Long
Dim StartRow As Long
Dim RowNdx As Long
Set WS = Worksheets("Sheet1") '<<<<
Col = "K" '<<<<
StartRow = 1 '<<<<
With WS
LastRow = .Cells(.Rows.Count, Col).End(xlUp).Row
For RowNdx = StartRow To LastRow
.Cells(RowNdx, "A").Value = whatever
Next RowNdx
End With
There are any number of other ways of defining what constitutes the
"end" of a worksheet. You might want to be more specific about what
you really need.
Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com