Hi all,

I am new to excel 2007 and macro's, I have used couple of macros and would like to combine them together..please help

Excel 2007
1st macro

Public Sub MyInputBox()

Dim MyInput As String
MyInput = InputBox("This is my InputBox", _
"MyInputTitle", "Enter your input text HERE")

If MyInput = "Enter your input text HERE" Or _
MyInput = "" Then
Exit Sub
End If

MsgBox "The text from MyInputBox is " & MyInput

End Sub


It prompts a box for user input and display the input

2nd macro

Sub Test1()
Application.ScreenUpdating = True
Dim xRow&, NextRow&, LastRow&
NextRow = 2
LastRow = Cells.Find(What:="*", After:=Range("A1"), SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For xRow = 1 To LastRow
If WorksheetFunction.CountIf(Rows(xRow), "*hello*") > 0 Then
Rows(xRow).Copy Sheets("Sheet2").Rows(NextRow)
NextRow = NextRow + 1
End If
Next xRow
Application.ScreenUpdating = True
End Sub


It searches spreadsheet for keyword and compy the rows having the keywork into another workbook.

My dream for now - I would want it to prompt for user input, then search the keyword and copies the result into new workbook.

This will make my life lot easier, I have spent lot of time and always get error cos i don't know how vb works, any help would be of gr8 help.