title: How to create a dynamic variable in a loop in order to use less lines in code. VB NET
body: <p>I have a set of 81 buttons in my vb net studio. They are sorted 9x9 creating a sudoku patern. (Image 1)</p>
  <p>Image 1: <a href="https://prnt.sc/10d49ci" rel="nofollow noreferrer">https://prnt.sc/10d49ci</a></p>
  <p>When i click the Generate button it generates random numbers from 1 to 9 into MyArr(9,9).
  Next i want to set the buttons to those values of MyArr() according to their position.</p>
  <p>For example Button1 named Cell00 should i write &quot;Cell00.Text = MyArr(0,0)&quot;</p>
  <p>For Button2 named Cell01 should i write &quot;Cell01.Text = MyArr(0,1)&quot; and so on.</p>
  <p>Is there any way to set those values without writing one by one until last Button? My Buttons names are Cell00, Cell01,Cell02....Cell08 next line Cell10,Cell11 and so on.
  I try to do this in a loop <code>Cell &amp; i.ToString &amp; j.ToString.Text = MyArr(i,j)</code> check the image 2</p>
  <p>Image 2: <a href="https://prnt.sc/10d4djn" rel="nofollow noreferrer">https://prnt.sc/10d4djn</a> &lt;--- Code here</p>
  <p>The .Text added as example. I suppose something like this but does not work.</p>
  <p>For example <code>Cell01.Text = MyArr(0,1)</code>
  Any idea?</p>