dear all ,
i need to find a cell value in another workbook.
when the value in column B is found i than need to paste there the entire row (starting from column A ) of the previous cell but i get an error.
tried different way but still not working .
tks if someone can help
i need to find a cell value in another workbook.
when the value in column B is found i than need to paste there the entire row (starting from column A ) of the previous cell but i get an error.
tried different way but still not working .
tks if someone can help
VBA Code:
Sub copiaincolla()
Dim foundrange As Range
Dim test1
test1 = ActiveCell.Offset(0, -18)
ActiveCell.EntireRow.Copy
Workbooks.Open Filename:="X:\CargoluxItalia\GROUND OPS\riskregister.xlsx", Ignorereadonlyrecommended:=True
Workbooks("riskregister").Unprotect
Set foundrange = Workbooks("riskregister").Sheets("sheet1").Range("b:b").Find(test1, , xlValues, xlWhole, xlByRows, xlNext, False, False, False)
If Not foundrange Is Nothing Then
Workbooks("riskregister").Sheets("Sheet1").Select
[COLOR=rgb(226, 80, 65)]foundrange.Offset(0, -1).PasteSpecial[/COLOR]
End If
End Sub