Macro in Excel
Christina,
Selecting cells is a poor way of doing what you want because it takes time
and you can almost certainly achieve what you want without selecting
anything. The snippet of code below loops through the used range of column A
Sub Christina()
Dim MyRange As Range
Dim LastRow As Long
Set Sht = Sheets("Sheet1")
LastRow = Sht.Cells(Cells.Rows.Count, "A").End(xlUp).Row
Set MyRange = Sht.Range("A1:A" & LastRow)
For Each c In MyRange
'your code
Next
End Sub
--
Mike
When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
"Christina" wrote:
I am creating a macro, and need to select the next cell down after the
selected cell, and then to run the entire macro until the end of the data on
the sheet.
I am new, and would like very basic instructions, please.
Thanks, Cristina
|