Macro
Closed
cool
-
16 Oct 2009 à 10:08
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 16 Oct 2009 à 22:29
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 16 Oct 2009 à 22:29
Related:
- Macro
- Run macro in excel - Guide
- How to run a macro in excel - Guide
- How to copy macro from one workbook to another - Guide
- Macro for number to words in excel - Guide
- Macro antena apk - Download - Gaming tools
1 response
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
16 Oct 2009 à 22:29
16 Oct 2009 à 22:29
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