Hi,
I have a button to copy some cells to Sheet9. Please see the code below. This code copy data to next empty row in Sheet9. However, I have some math formula/function in column M, N and P in Sheet9. When I press the button, it's copying to the end after the last function row.
How do I make it so that its ignore function and copy to the next empty row in Sheet9 based on column A?
I have a button to copy some cells to Sheet9. Please see the code below. This code copy data to next empty row in Sheet9. However, I have some math formula/function in column M, N and P in Sheet9. When I press the button, it's copying to the end after the last function row.
How do I make it so that its ignore function and copy to the next empty row in Sheet9 based on column A?
Code:
Private Sub copy1_Click()
erw = Sheet9.Cells(1, 1).CurrentRegion.Rows.Count + 1
Sheet9.Cells(erw, 1) = Range("B2")
Sheet9.Cells(erw, 2) = Range("C3")
Sheet9.Cells(erw, 3) = Range("C4")
Sheet9.Cells(erw, 4) = Range("C5")
Sheet9.Cells(erw, 9) = Range("C6")
Sheet9.Cells(erw, 10) = Range("C12")
Sheet9.Cells(erw, 11) = Range("C16")
Sheet9.Cells(erw, 12) = Range("C14")
End Sub