title: Get corresponding Range for Button interface object
body: <p>I want when I click the button &quot;Sélectionner un poste&quot; it will tell me the position. (The button which I clicked in which row.)</p>
  <p>Code to create the button:</p>
  <pre class="lang-vb prettyprint-override"><code>Sub AjouterBoutonPoste(positionX As Integer, positionY As Integer, nom As String)
      Set t = ActiveSheet.Range(Cells(positionX, positionY), Cells(positionX, positionY))
      Set btn = ActiveSheet.Buttons.Add(t.Left, t.Top, t.Width, t.Height)
      With btn
          .OnAction = &quot;PosteBtAction&quot;
          .Caption = &quot;Sélectionner un poste&quot;
          .Name = nom &amp; CStr(positionX) &amp; CStr(positionY)
      End With
  End Sub
  </code></pre>
  <p>Code for the event button:</p>
  <pre class="lang-vb prettyprint-override"><code>Sub PosteBtAction()
     AssocierSessoinCandidature.Show
  End Sub
  </code></pre>
  <p>I have an application window named <code>AssocierSessoinCandidature</code>. I want the position which I clicked sent to the application window.</p>
  <p>Here is my example Excel sheet:<br />
  <img src="https://i.stack.imgur.com/ulFG8.png" alt="" /></p>