When i run this macro, it will ask "Search for what", when i give the date
for ex: 3/7/2008. It will search for this date in H column in the sheet "TAT
invoice processed", if the date is found, the entire rows will be copied
from the sheet TAT Invoice processed to another sheet "DailyTAT invoice
processed".
But the macro is not working properly.... It searches the date for the range
& not in H column......but I want this macro to search the date *ONLY IN H
column. *
Can you helpme in rectifying this.
Sub copyTATinvoiceProcessed()
response = InputBox("Search for what")
Dim MyRange, MyRange1 As Range
Sheets("TAT Invoice Processed").Select
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
*Set MyRange = Sheets("TAT Invoice Processed").Range("A11:H" & lastrow)
*For Each c In MyRange
If UCase(CStr(c.Value)) = UCase(response) Then
If MyRange1 Is Nothing Then
Set MyRange1 = c.EntireRow
Else
Set MyRange1 = Union(MyRange1, c.EntireRow)
End If
End If
Next
If MyRange1 Is Nothing Then
MsgBox ("No Matches for " & response)
Exit Sub
End If
If (Sheets("DailyTAT Invoice Processed").Range("A11") <> "") Then
Sheets("DailyTAT Invoice Processed").Rows("11:" &
Range("A11").End(xlDown).Row).Delete Shift:=xlUp
End If
MyRange1.Select
Selection.Copy
Sheets("DailyTAT Invoice Processed").Select
Range("A11").Select
ActiveSheet.Paste
End Sub