title: excel macro to add value from cell to a table
body: <p>I am looking to use a macro to add the value of a certain cell in a worksheet to a table in another worksheet each time each time a button is pressed. For example, the first time the button is pressed I want the value of cell A1 in worksheet2 to be equal to cell C3 in worksheet1, next time B1 in worksheet2 is equal to C3 in worksheet1 , and so on. The macro should only add a value to the table if the cell thst it's being added to is empty.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>Sub Button32_ClickandUpdate
      myVariable = Worksheets("Worksheet1").Range("C3")
  
      For i = 1 To 6
          If IsEmpty(Cells(1, i)) Then
              Worksheets("Worksheet2").Range(Cells(1,i)) = myVariable
              Exit Sub
          End If
      Next i
  End Sub
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>