Thread: loop
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] streamaxi@gmail.com is offline
external usenet poster
 
Posts: 16
Default loop

thanx

acampbell wrote:
Sub Prod()
Dim MyRange As Range
Set MyRange = Range("G7:G100") ' adjust as needed
For Each cell In MyRange
If cell.Offset(0, -1).Value = "Production" Then
cell.Select
Exit Sub
End If
Next
End Sub

wrote:
Somewhere in column F i have the value "Production". It could be in
F100 or F157. It is not known.
My cursor is in cell G7. I am using activecell.offset(1,0).select to
scroll downwards. I want to move my cursor in column G only till the
row where the cell value in column F is "Production" what would be the
syntax?

something like While Not Cells(row, 6).Value = "Production"