Search code examples
excelvbacopycopy-paste

copy value until last full row in next column


I need to copy the value of one cell (A1 lets say) on column B from B1 until the last used row in column C (C15 let's say - This means that I need to copy from B1 to B15)

So far I don't have any code - Im a beginner

Any help will be much appreciated!


Solution

  • This can be done using VBA as below

    Sub fill()
      'counting last row in Column C
      lrow = Cells(Rows.Count, 3).End(xlUp).Row
    
      'copying Range A1 to all cells on Column B until last row in Column C
      Range(Cells(1, 2), Cells(lrow, 2)).Value = Cells(1, 1)
    End Sub