Obtenir de la valeur après avoir trouvé des données VA

Je cherche un moyen d'get de la valeur après la découverte chaque fois que je presse un button, j'ai utilisé des cellules (rows.count, 1) .value et ainsi de suite, mais cela ne fonctionnait toujours pas.
voici mon code

Private Sub CopyNota_Click() On Error GoTo errorhandler: Application.ScreenUpdating = False Dim strpath As Ssortingng Dim copysheet As Worksheet Dim pastesheet As Worksheet Set copysheet = Worksheets("sheet3") Set pastesheet = Worksheets("sheet5") strpath = "E:\b\" Filename = Dir(strpath & "b.xlsx") If IsEmpty(Range("B2")) Then Workbooks("b.xlsx").Worksheets("sheet3").Range("H2").Copy destination:=Range("B2") Workbooks("b.xlsx").Worksheets("sheet3").Range("I2").Copy destination:=Range("C2") Workbooks("b.xlsx").Worksheets("sheet3").Range("J2").Copy destination:=Range("D2") Workbooks("b.xlsx").Save Application.CutCopyMode = False Application.ScreenUpdating = True Else Workbooks("b.xlsx").Worksheets("sheet3").Range("H2").Copy Worksheets("sheet5").Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues Workbooks("b.xlsx").Worksheets("sheet3").Range("I2").Copy Worksheets("sheet5").Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues Workbooks("b.xlsx").Worksheets("sheet3").Range("J2").Copy Worksheets("sheet5").Cells(Rows.Count, 4).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues Workbooks("b.xlsx").Worksheets("sheet3").Range("A2").Value = Worksheets("sheet5").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Value End If errorhandler: If Err.Number = "52" Then MsgBox "Open The Workbooks First!!!" Exit Sub End If End Sub 

Quelqu'un me prêterait-il une idée de mes problèmes?

Merci d'avance

Essaye celui-là :

 Private Sub CopyNota_Click() On Error GoTo errorhandler: Application.ScreenUpdating = False Dim copysheet As Worksheet, pastesheet As Worksheet Dim wbk As Workbook Dim bolDoNotOpen As Boolean Filename = "E:\b\b.xlsx" 'check if any of the opened workbook name is equal to the "b.xlsx" For Each wbk In Workbooks If wbk.Name = "b.xlsx" Then bolDoNotOpen = True End If Next wbk 'if none of the workbooks name = "b.xlsx" , then the "b.xlsx" is not open, so we can open it. If bolDoNotOpen = False Then Workbooks.Open Filename End If Set copysheet = Workbooks("b.xlsx").Worksheets("sheet3") 'added workbook reference Set pastesheet = Workbooks("b.xlsx").Worksheets("sheet5") 'added workbook reference If IsEmpty(pastesheet.Range("B2")) Then pastesheet.Range("B2:D2").Value = copysheet.Range("H2:J2").Value Workbooks("b.xlsx").Save Else 'you can change this to do all the values at once. But only if you know, that their row will always be the same. pastesheet.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0) = copysheet.Range("H2") pastesheet.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0) = copysheet.Range("I2") pastesheet.Cells(Rows.Count, 4).End(xlUp).Offset(1, 0) = copysheet.Range("J2") copysheet.Range("A2") = pastesheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) End If Application.ScreenUpdating = True Exit Sub 'obsolete now, we have checked or opened the workbook at the beginning errorhandler: If Err.Number = "52" Then MsgBox "Open The Workbooks First!!!" Exit Sub End If End Sub