title: Automatically copy content to range of cells in excel using VBA
body: <p>Below is my <strong>initial</strong> excel sheet</p>
  
  <p><img src="https://i.stack.imgur.com/F6K52.jpg" alt="enter image description here"></p>
  
  <p>Below is what my <strong>output</strong> should be</p>
  
  <p><img src="https://i.stack.imgur.com/eLe7b.jpg" alt="enter image description here"></p>
  
  <p>My approach:</p>
  
  <ul>
  <li><p>Get the first value from column A </p>
  
  <p>Get the Offset(0,1) of column A (results in B1) </p>
  
  <p>Get the number of records from column B till the first empty cell (results in 3)
  Copy value of A1 to the cells (number of records - 1) below A1</p></li>
  <li>Loop for all the 3 values in column A</li>
  </ul>
  
  <p>I have implemented till I get the addresses of the cells with values in column A. Below is my code.</p>
  
  <pre><code>  Dim currentRow As Integer
    Dim element As Variant
    Dim totalRows As String
    Dim offsetrow As String
    Dim offsetcell As Variant
  
    totalRows = Range("A" &amp; ActiveSheet.Rows.Count).End(xlUp).row
    MsgBox (totalRows)
  
  
    For currentRow = 1 To totalRows
      If (IsEmpty(Cells(currentRow, 1).Value)) Then
  
      Else
          Cells(currentRow, 1).Select
          offsetcell = ActiveCell.Offset(0, 1).Address
  
          'Do the rest
      End If
    Next
  
  End Sub
  </code></pre>
  
  <p>Any help is appreciated </p>