Hi,
I have the following code. The last part of the codes were to copy a range of data and paste it onto another range on different sheet. I tested every single line of the code up to that point but couldn't figure out why it doesn't work.
Wonder if someone could please help?
I have the following code. The last part of the codes were to copy a range of data and paste it onto another range on different sheet. I tested every single line of the code up to that point but couldn't figure out why it doesn't work.
Wonder if someone could please help?
Code:
Public finalRow_Paste As Integer
Public finalRow_2_Wks_Trades As Integer
Public Sub Initiate()
Dim sht_Paste As Worksheet
Dim sht_2_Wks_Orders As Worksheet
Set sht_Paste = ThisWorkbook.Worksheets("Paste")
Set sht_2_Wks_Orders = ThisWorkbook.Worksheets("2_Wks_Orders")
finalRow_Paste = sht_Paste.Cells(sht_Paste.Rows.Count, "b").End(xlUp).Row
finalRow_2_Wks_Orders = sht_2_Wks_Orders.Cells(sht_2_Wks_Orders.Rows.Count, "a").End(xlUp).Row
End Sub
Public Sub Macro1()
Dim days_Elapsed As Integer
ThisWorkbook.Sheets("Paste").Range("1:9").Delete xlUp
Call Initiate
ThisWorkbook.Sheets("Paste").Range(finalRow_Paste + 1 & ":" & finalRow_Paste + 3).Delete xlUp
Worksheets("Hold_Sht").Cells.Clear
Set rngCopy = Worksheets("Paste").Range("A2").Offset(finalRow_Paste, 18)
Set rngCopyHeader = Worksheets("Paste").Range("A1").Offset(finalRow_Paste, 18)
Set rngPaste = Worksheets("Hold_Sht").Range("A2")
Set rngPaste_2 = Worksheets("2_Wks_Orders").Range("A" & finalRow_2_Wks_Orders + 1)
rngCopyHeader.Copy Destination:=rngPaste
rngCopy.Copy Destination:=rngPaste_2