View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Robert[_32_] Robert[_32_] is offline
external usenet poster
 
Posts: 23
Default Loop Thru Values in a Column

I thought I was there but the LastRow is equal to 1 so nothing is found. The
actual data does not start until row 5 and there are blanks.
--
Robert Hill



"Gary''s Student" wrote:

How about:

Sub ordinate()

Set r = Range("AJ:AJ")
Set r2 = Sheets("Sheet2").Range("A1")

LastRow = Cells(Cells.Rows.Count, "AJ").End(xlUp).Row

For i = 1 To LastRow
v = Cells(i, "AJ").Value
If v = "D" Or v = "Q" Then
r2.Value = Cells(i, "A").Value
End If
Next
End Sub

--
Gary's Student
gsnu200705


"Robert" wrote:

I need to loop thru values in a secific column such as 'AJ'. When I find a
'D', or a 'Q', I want to put the name of the perosn in column A into another
spreadsheet. I find examples of summing values in a column but not locating
cerain values.

Thanks for assistance...
--
Robert Hill