vba - excel macro deleting extra rows -


I have a macro that removes the rows that I do not want in Excel. It extends the lines before 9:30 and after 4:00 pm. For some reason, it also removes the rows that are from 10:00 to 10:00 am, from 11:00 a.m. to 11:00 p.m., from 12:00 a.m. to 1:00 p.m. 1:00 am, 2:00 pm to 2 pm, 3 pm to 3 pm

Please help me so that it does not delete those lines.

My code:

  Removed deleted lines () Keep ActiveSheet 'Find the last line of your dataset LastRow =. Range ("A: A"). Search ("*", search direction: = xl pre-paid). 'Formatting your time column on a readable time. Columns ("B"). Number format = "[$ -F400] H: mm: SS AM / PM" loop through rows, start from bottom. Cell = date 2 for a final row - 1 piece piece together DT = Mid (Cell, 1), 5, 2) & amp; "/" & Amp; _mid (.sec (cell, 1), 7, 2) & amp; "/" & Amp; Left (Cell, 1), 4) If the date is Saturn or Sun, then delete the line if day of day (DT) = 1 or day of the week (DT) = 7 again. Kintryrrokdur or 'If 9: after the first 30 hours or 4 hours, remove the line Aelaiaiaif Siaianti (h (. (room 2)) and minutes (. (cell, 2))) & lt; 930 or _ CINT (bell (. (Cell, 2)) and minute (. (Cell, 2))) gt; After 1600.Ro (cell) Interstate End if MsgBox with the next cell closing "Done!"  

You can check the value against the actual time You can try:

  'Else If the time after 9:30 pm or after 4 o'clock, remove the line. Cells (cell, 2) - int. (Cell, 2)) & lt; CDAT ("09:30:00") or _. Cell (cell, 2) - int. (Cell, 2)) gt; CDAT ("16:00:01") then .reave (cell). Interval Delete  

Upper bound note 16:00:01 avoids a limit 16:00:00 at

Evaluation error (probably due to round).

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -