Hi all,
I have a code o extract data (works perfect) I now am trying to paste that data back to data sheet if changed.
I have a command button I have attached below code, when I click I get msg "Compile error: Wrong number of arguments or invalid property assignment"
Sub Pre_Alert_Update()
Dim i As Long
Dim j As Long
Dim lastrow1 As Long
Dim lastrow2 As Long
Dim NFLJobNo As String
lastrow1 = Sheets("sheet8").Range("B" & Rows.Count).End(xlUp).Row
For i = 2 To lastrow1
NFLJobNo = Sheets("sheet8").Cells(i, "B").Value
Sheets("sheet1").Activate
lastrow2 = Sheets("sheet1").Range("B" & Rows.Count).End(xlUp).Row
For j = 2 To lastrow2
If Sheets("sheets1").Cells(j, "A").Value = NFLJobNo Then
Sheets("sheet8").Activate
Sheets("sheet8").Range(Cells(i, 3, 21)).Copy
Sheets("sheet1").Activate
Sheets("sheet1").Range(Cells(j, 3, 33)).Select
ActiveSheet.Paste
End If
Next j
Application.CutCopyMode = faluse
nexti
Sheets("sheet8").Activate
Sheets("sheet8").Range("G3").Select
End Sub
Regards,
Dale
I have a code o extract data (works perfect) I now am trying to paste that data back to data sheet if changed.
I have a command button I have attached below code, when I click I get msg "Compile error: Wrong number of arguments or invalid property assignment"
Sub Pre_Alert_Update()
Dim i As Long
Dim j As Long
Dim lastrow1 As Long
Dim lastrow2 As Long
Dim NFLJobNo As String
lastrow1 = Sheets("sheet8").Range("B" & Rows.Count).End(xlUp).Row
For i = 2 To lastrow1
NFLJobNo = Sheets("sheet8").Cells(i, "B").Value
Sheets("sheet1").Activate
lastrow2 = Sheets("sheet1").Range("B" & Rows.Count).End(xlUp).Row
For j = 2 To lastrow2
If Sheets("sheets1").Cells(j, "A").Value = NFLJobNo Then
Sheets("sheet8").Activate
Sheets("sheet8").Range(Cells(i, 3, 21)).Copy
Sheets("sheet1").Activate
Sheets("sheet1").Range(Cells(j, 3, 33)).Select
ActiveSheet.Paste
End If
Next j
Application.CutCopyMode = faluse
nexti
Sheets("sheet8").Activate
Sheets("sheet8").Range("G3").Select
End Sub
Regards,
Dale