title: VBA - Add different ships on the worksheet
body: <p>I am pretty new to VBA. I am trying to create a simple battleship game. When a user is clicking on the game area, I would like to create a pop-up that allows me to insert different elements.</p>
  
  <p>Example: </p>
  
  <pre><code>Ship 1 (length 2 columns &amp; colour "red")
  Ship 2 (length 3 columns &amp; colour "blue")
  Ship 3 (length 4 columns &amp; colour "black")
  Ship 4 (length 5 columns &amp; colour "green")
  </code></pre>
  
  <p>What would be the best way to achieve this (userform or CommandButton clicks)? Do you have any examples?</p>
  
  <p>That's what I have written so far:</p>
  
  <p><strong>Worksheet area</strong></p>
  
  <pre><code>Private Sub CommandButton1_Click()
  Dim chemin1 As Object
  Set chemin1 = Application.ThisWorkbook.Worksheets(1)
  With chemin1
      .Clear
      .Range("A1:J10").Interior.ColorIndex = 36
  With Range("A1:J10").Borders(xlEdgeTop)
          .LineStyle = xlContinuous
          .ColorIndex = 0
          .TintAndShade = 0
          .Weight = xlThin
      End With
      With Range("A1:J10").Borders(xlEdgeBottom)
          .LineStyle = xlContinuous
          .ColorIndex = 0
          .TintAndShade = 0
          .Weight = xlThin
      End With
      With Range("A1:J10").Borders(xlEdgeRight)
          .LineStyle = xlContinuous
          .ColorIndex = 0
          .TintAndShade = 0
          .Weight = xlThin
      End With
      With Range("A1:J10").Borders(xlInsideVertical)
          .LineStyle = xlContinuous
          .ColorIndex = 0
          .TintAndShade = 0
          .Weight = xlThin
      End With
      With Range("A1:J10").Borders(xlInsideHorizontal)
          .LineStyle = xlContinuous
          .ColorIndex = 0
          .TintAndShade = 0
          .Weight = xlThin
      End With
      End With
  
  End Sub
  </code></pre>
  
  <p><strong>Action to add the ships in the worksheet</strong></p>
  
  <pre><code>Private Sub CommandButton1_Click()
  Dim LB_2 As Variant, LB_3, LB_4 As Variant, LB_5 As Variant
  Dim LB_6 As Variant
  Set chemin1 = Application.ThisWorkbook.Worksheets(1)
  With chemin1
  LB_2 = TB_1.variant
  .Range("TB_1").Interior.ColorIndex = 22
  LB_3 = TB_2.variant
  .Range("TB_2").Interior.ColorIndex = 22
  LB_4 = TB_3.variant
  .Range("TB_3").Interior.ColorIndex = 22
  LB_5 = TB_4.variant
  .Range("TB_4").Interior.ColorIndex = 22
  LB_6 = TB_5.variant
  .Range("TB_5").Interior.ColorIndex = 22
  End With
  
  End Sub
  
  Private Sub TextBox1_Change()
  
  End Sub
  </code></pre>