title: Excel VBA Application.OnKey
body: <p>I am using the following to run macro "SQL" when I press the enter key.</p>
  
  <pre><code>Private Sub Workbook_Open()
  
  Application.OnKey "~", "SQL"
  
  End Sub
  </code></pre>
  
  <p>But, I would like to run macro "SQL" only when in column 1 (column A).
  Once the macro runs my active cell is in column 9 (column I) and I would like to run a second macro when I press the enter key in this column?</p>
  
  <p>I tried the following, but the macro "SQL" tries to run for both column 1 and column 9?</p>
  
  <pre><code>Private Sub Workbook_Open()
  
  If ActiveCell.Column = 1 Then    
      Application.OnKey "~", "SQL"    
  Else    
      Application.OnKey "~", "SCAN_MEZBOX"    
  End If
  
  End Sub
  </code></pre>
  
  <p>Can anyone help me please?</p>