search for next row

D

damorrison

I would like to have a macro that searches the range Say A10:A15 if
there is a value in A10 then goto B10 do what I have to do in a
userform then click ok, then it goes to see if there is a value in the
next row
 
T

Tom Ogilvy

for each cell in range("A10:A15")
if isempty(cell) then cell.offset(0,1).Select
userform1.show
end if
Next
 
D

damorrison

Thanks alot, what is the opposite of
IsEmpty
right now the macro stops at the first empty row
I need it to stop at the next row with a value in the A10:A15 range
 
D

damorrison

This what I am trying to do

For Each cell In Range("A10:A15")
If Not IsEmpty(cell) Then
cell.Offset(0, 1).Select
Application.SendKeys "%{down}"
End If
Next

when a selection is made in colmn B the userform shows
 
P

paulandrewmorgan

something like this?

Dim r As Integer
r = ActiveCell.Row + 1
Do While (r <= 15)
If Not IsEmpty(Range("A" & r)) Then
Range("B" & r).Select
Application.SendKeys "%{down}"
Exit Do
End If
r = r + 1
Loop
The loop stops at row 15
 
Top