View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gareth[_3_] Gareth[_3_] is offline
external usenet poster
 
Posts: 109
Default Help with some code please

This is what I want this particular piece of code to do:

Check column B, if the value in column B is 1 then check column's K and L to
see if either of them have an entry in them. If there is an entry in
either, or both, and column F does not contain 'No' then display a msgbox
with the value of column C in it.

This is what I have so far, I am am stuck on the And Or bits:

Sub Check()
Application.ScreenUpdating = False
With Worksheets("Sheet1")
Set rng = .Range("B2:B" & .Range("B" & Rows.Count).End(xlUp).Row)
End With
For Each cell In rng
If cell.Value = 1 And .......Or ......And ......Then
MsgBox "Please check " & cell.Offset(0,1).Value
End If
Next cell
Application.ScreenUpdating = True
End Sub

Thanks in advance.

Gareth