Thread: isempty close
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default isempty close

Hi Curt -

Copy the first two procedures to the worksheet's module and the third
procedure to a standard module:

Private Sub Worksheet_Activate()
Application.OnKey "{RETURN}", "checkUp"
Application.OnKey "{DOWN}", "checkUp"
End Sub

Private Sub Worksheet_Deactivate()
Application.OnKey "{RETURN}"
Application.OnKey "{DOWN}"
End Sub

Sub checkUp()
chkRow = ActiveCell.Row
If chkRow = 1 Then
ActiveCell.Offset(1, 0).Activate
Exit Sub
End If
For Each cel In Range(Cells(chkRow, 1), Cells(chkRow, 11))
If Trim(cel) = "" Then
MsgBox "Finish This Row"
cel.Activate
Exit Sub
End If
Next 'cel
ActiveCell.Offset(1, 0).Activate
End Sub

--
Jay


"Curt" wrote:

If Target.Row < 2 Then Exit Sub
If Application.CountA(Rows(Target.Row - 1)) And IsEmpty(Target.Value) <
11 Then _
MsgBox "Finish Last Row"
want to check row up to column 11 for empty cells. want this to happen if
user hits enter or down arrow to start a new row. I am off as the msgbox pops
up when entering in row. should not come up till in next roe if blanks left
in tatget row. Have used .CountA(cells (columns to no avail
need help
Thanks