Mr Clickalot
New Member
- Joined
- Feb 7, 2009
- Messages
- 37
Below is the current macro that I have, This searches the whole sheet for key words. It is ideal in the fact that it does not have to be exact. When it finds the entry it simply selects it but heres the problem;
Instead of just highlighting the cell I would like it to copy that row to the next sheet (in my case thats called "Bundle")...
Please give suggestions, If you have a better search macro for excel that searches key words and pastes I will be happy to give it a try!
Instead of just highlighting the cell I would like it to copy that row to the next sheet (in my case thats called "Bundle")...
Code:
Sub Find_Data()
Dim datatoFind
Dim sheetCount As Integer
Dim counter As Integer
Dim currentSheet As Integer
On Error Resume Next
currentSheet = ActiveSheet.Index
datatoFind = InputBox("Please enter the value to search for")
If datatoFind = "" Then Exit Sub
sheetCount = ActiveWorkbook.Sheets.Count
For counter = 1 To sheetCount
Sheets(counter).Activate
If IsError(Cells.Find(What:=datatoFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate) = False Then Exit For
Next counter
If ActiveCell.Value <> datatoFind Then
Sheets(currentSheet).Activate
End If
End Sub
Please give suggestions, If you have a better search macro for excel that searches key words and pastes I will be happy to give it a try!