Hello guys,
What I need to do is to find CP1 in a determined column, if it does, copy the cell and paste it into other file (Dabase.xlsm), if not it should look for CP2 until CP4. If doent find any of them, Delete the sheet.
But until know, I havent find the way to pass the error if it doesnt find anything. This is what I have:
Thanks in advance for the help!!
CP1 = "WEA"
' Select Resp. Company entire column and Find CP1
Windows("MorningReport.xls").Activate
Range("A1").Select
Cells.Find(What:="Resp. Co", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
ActiveCell.EntireColumn.Select
Selection.Find(CP1).Activate
' If it finds - Copy and Paste to Database
ActiveCell.Select
Selection.Copy
Windows("Database DS.xlsm").Activate
Range("A1").Select
Cells.Find(What:="Company", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
End Sub
Bookmarks