Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88854

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

$
0
0

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


Viewing all articles
Browse latest Browse all 88854


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>