Thread: Lookup VBA
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Lookup VBA

I believe you should put an Exit For statement after your MsgBox statement,
otherwise you will pop up the MessageBox for each set of cells meeting the
If..Then test.

--
Rick (MVP - Excel)


"Gary''s Student" wrote in message
...
Sub FindMissing()
Dim k As Long, i As Long
With Sheets("Sheet2")
k = Cells(Rows.Count, "K").End(xlUp).Row
For i = 4 To k
If Cells(i, "K").Value < "" And Cells(i, "I").Value = "" Then
MsgBox "Please update the sheet"
End If
Next
End With
End Sub

--
Gary''s Student - gsnu201001


"tomjoe" wrote:

I have a workbook with 2 sheets.
I am looking for a short procedure that detects if there, in sheet 2, is
any
occupied cell in column K (K4 and down) with no data in the cell to the
right
(column I). Then a message should pop up saying: "Please update the
sheet".

Any suggestions?