I have a VBA code-block which I want to amend very slightly. Please see the code-block I am referring to below. I will explain further.
If prev_row <> 0 And Worksheets("Block Chain").Range(change_type_column & last_row).Value = "New" Then
For curColumn = 1 To last_col
column_title = Worksheets("Block Chain").Cells(1, curColumn).Value
If column_title <> "change type" Then
If Worksheets("Block Chain").Cells(last_row, curColumn).Value <> Worksheets("Block Chain").Cells(prev_row, curColumn).Value Then
first_empty_row = Worksheets(column_title).Cells(Rows.Count, 1).End(xlUp).Row + 1
Worksheets("Block Chain").Range(last_row & ":" & last_row).Copy Worksheets(column_title).Range(first_empty_row & ":" & first_empty_row)
End If
End If
Next curColumn
End If
The piece of code in here I am referring to is:
Worksheets("Block Chain").Range(last_row & ":" & last_row).Copy Worksheets(column_title).Range(first_empty_row & ":" & first_empty_row)
At the moment, this line copies a row from one worksheet (Block Chain) and pastes it into the last row of whichever worksheet is currently stored in the variable column_title.
Now, I want to amend this code to do the following:
- I want it to copy the row from
Block Chain, which it already does - I want it to look for the row in the
column_titleworksheet which has the matching value in columnA - Lastly, I want the code to paste the copied row over the row located in step 2
If you know how to re-write this code to do what I have specified above, I would greatly appreciate your help.
Thank you very much.