defining an event procedure (lostfocus) that works on a column range

J

juhlott

I am trying to write an event procedure that works for an
entire column (lostfocus).

private sub a_LostFocus() works when I run the program
but not generally in excel
 
B

Bernie Deitrick

juhlott,

You could use the selection change event, along the lines of this, to show
when at least one cell in column A is not selected:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Range("A:A"), Target) Is Nothing Then Exit Sub
MsgBox "You haven't selected a cell in column A"
End Sub

HTH,
Bernie
MS Excel MVP
 
Top