Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not sure if you wanted to search for the 2nd "7p2" after wopr or not.
Sub FindAndCopy() Sheets("Eclipse").Select Range("A1").Select Cells.Find(What:="wopr", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False).Activate Cells.Find(What:="7p2", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _ xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _ .Activate Cells.Find(What:="7p2", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _ xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _ .Select x = ActiveCell.Address Selection.End(xlDown).Select y = ActiveCell.Address Range(x, y).Select Application.CutCopyMode = False Selection.Copy Sheets("Sheet1").Select Range("D2").Select ActiveSheet.Paste End Sub "Tim" wrote in message ... I get this error when i try to run, how could i place variables in the selection. Sheets("Eclipse").Select Range("A1").Select Cells.Find(What:="wopr", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False).Activate Cells.Find(What:="7p2", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _ xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _ .Activate x = Cells.Find(What:="7p2", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _ xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _ .Activate y = Selection.End(xlDown).Select Range("A$x:A$y").Select <-----------------------------------------------------------------Problem line Application.CutCopyMode = False Selection.Copy Sheets("Sheet1").Select Range("D2").Select ActiveSheet.Paste End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Select method of Range class failed" Error | Excel Discussion (Misc queries) | |||
Autofill method of range class failed | Excel Discussion (Misc queries) | |||
"method 'execute' of object 'find' failed" | Excel Discussion (Misc queries) | |||
Run-time error "1004" Select method of range class failed | Excel Discussion (Misc queries) | |||
"Run-time error '1004'" Method 'Range' of object '_global' failed. | Excel Programming |