(Solved) – Run-time Error 1004 on my VBA Excel code – transfer data from one worksheet to another

  • by
(solved)-–-run-time-error-1004-on-my-vba-excel-code-–-transfer-data-from-one-worksheet-to-another

VBA Code to transfer value of one cell to another worksheet

Sub Button4_Click()

Dim Description As String

Worksheets("Job Order Format").Select

Description = Range("C20")

Worksheets("Job Order Record").Select

Worksheets("Job Order Record").Range("E5").Select

If Worksheets("Job Order Record").Range("E5").Offset(1, 0) <> "" Then

Worksheets("Job Order Record").Range("E5").End(x1Down).Select

End If

ActiveCell.Offset(1, 0).Select

ActiveCell.Value = Description

Worksheets("Job Order Format").Select

Worksheets("Job Order Format").Range("C20").Select

End Sub

The code works for the 1st attempt with no error but for the 2nd attempt I get an error of Run-time Error 1004.

enter image description here

enter image description here

enter image description here

Leave a Reply

Your email address will not be published. Required fields are marked *