Recorded and cleaned up macro to find smith and copy row to another sheet
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 8/2/2008 by Donald B. Guillett
'
'
Columns("J:J").Select
Selection.Find(What:="smith", After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Rows("5:5").Select
Selection.Copy
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Sheet2"
Rows("8:8").Select
ActiveSheet.Paste
End Sub
Sub findandcopyrow()
Columns("J").Find(What:="smith", After:=Cells(1, "J"), LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).EntireRow.Copy _
Sheets("Sheet2").Rows("8:8")
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"gsxith3" wrote in message
...
I would like to add a button to a worksheet that would allow input of an
value to be search fro in column C. If the value is found the entire
contents of the row would then be added to a new worksheet. I was trying
to
write a macro to do this- but alas it appears to be beyond me, Any help
would be greatly appreciated!