Hello,
I am attempting to simply move data from one cell in a worksheet to another cell in the same worksheet in a loop. I believe I have declared variables correctly and this seems like a relatively simple task but I am still getting an error in the line highlighted in red.
Option Explicit
Sub autofill()
Dim shS As Worksheet ' Source worksheet
Dim shD As Worksheet ' Destination worksheet
Dim lRow As Long
Dim sourceCol As Integer, rowCount As Integer, currentRow As Integer, sourceRow As Integer
Dim currentRowValue As String
Dim destinationColX As Integer, destinationColZ As Integer, destinationColY As Integer, destinationRow As Integer
sourceCol = 4
sourceRow = 4
destinationColX = 5
destinationColY = 6
destinationColZ = 7
destinationRow = 59
Do While sourceRow < 47
Range("destinationColX" & "destinationRow") = Range("sourceCol" & "sourceRow")
Loop
End Sub
Bookmarks