Macro
Closed
cool
-
Oct 16, 2009 at 10:08 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Oct 16, 2009 at 10:29 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Oct 16, 2009 at 10:29 PM
Related:
- Macro
- Excel online macro - Guide
- Excel run macro on open - Guide
- Macro for number to words in excel - Guide
- Excel macro download - Download - Spreadsheets
- How to copy macro from one workbook to another - Guide
1 response
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Oct 16, 2009 at 10:29 PM
Oct 16, 2009 at 10:29 PM
your second condition is dangerous because you will lose the data. so better copy sheet 1 in sheet 2 and the run this macro
do this experiment only on a sample data first.
do this experiment only on a sample data first.
Sub test()
Dim r As Range, cfind As Range, tt
Worksheets("sheet1").Select
Set r = Range(Range("a2"), Range("A2").End(xlDown))
With r
Set cfind = .Cells.Find(what:="harry", lookat:=xlWhole)
End With
tt = TimeValue(Now)
MsgBox tt
If tt >= TimeValue("9:00 am") And tt <= TimeValue("5:00 pm") Then
cfind.EntireRow.Delete
Else
r.EntireRow.Delete
End If
End Sub