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
- Spell number in excel without macro - Guide
- Macro excel download - Download - Spreadsheets
- Excel macro to create new sheet based on value in cells - Guide
- Run macro on opening workbook - Guide
- Excel vba assign macro to button programmatically - 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