title: Trigger event on TAB button click in Excel with VBA
body: <p>I am trying to set up a verification in an excel cell ,  so that nobody can leave it empty by clicking a tab button.</p>
  
  <p>So as soon as a user clicks the tab button with the empty cell , it should display a message.</p>
  
  <p>Do You have any clue for that?</p>
  
  <pre><code>Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  
  If iKeyCode = vbKeyTab Then    
      If CancSelEvnt = False Then    
          MsgBox (1)        
      Else 
          If IsEmpty(Cells(Target.Row, 7).Value) = True Then   
              MsgBox ("This cell should not be kept empty.")    
          End If       
      End If    
  End If
  
  End Sub
  </code></pre>
  
  <p>Just want any error message as soon as user moves from one cell to another cell in same row (using tab key)</p>