copy and paste find all rows through vba. is it possible via macros?

%3CLINGO-SUB%20id%3D%22lingo-sub-1435200%22%20slang%3D%22en-US%22%3Ecopy%20and%20paste%20find%20all%20rows%20through%20vba.%20is%20it%20possible%20via%20macros%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1435200%22%20slang%3D%22en-US%22%3E%3CP%3EOption%20Explicit%3C%2FP%3E%3CP%3ESub%20Test()%3C%2FP%3E%3CP%3EDim%20foundRng%20As%20Range%3C%2FP%3E%3CP%3E%3CBR%20%2F%3ESheets(%22Sheet1%22).Select%3CBR%20%2F%3ESet%20foundRng%20%3D%20Range(%22A1%22).CurrentRegion.Find(%22*Cable*%22%2C%20LookIn%3A%3DxlFormulas)%3CBR%20%2F%3EfoundRng.Rows(%221%3A1%22).EntireRow.Select%3CBR%20%2F%3ESelection.Copy%3CBR%20%2F%3ESheets(%22Sheet2%22).Activate%3CBR%20%2F%3ERange(%22A%22%20%26amp%3B%20Rows.Count).End(xlUp).Offset(1).Select%3CBR%20%2F%3EActiveSheet.Paste%3CBR%20%2F%3E%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1435200%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

Option Explicit

Sub Test()

Dim foundRng As Range


Sheets("Sheet1").Select
Set foundRng = Range("A1").CurrentRegion.Find("*Cable*", LookIn:=xlFormulas)
foundRng.Rows("1:1").EntireRow.Select
Selection.Copy
Sheets("Sheet2").Activate
Range("A" & Rows.Count).End(xlUp).Offset(1).Select
ActiveSheet.Paste

End Sub

 

0 Replies