Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Delete rows if time is greater than present time

Hello-

I have a spreadsheet that has times by 1/2 hour in column A for our workday.. The spreadsheet will always have the full workday of information in it over the past 4 weeks for the same day (last 4 Mondays, etc). I want to be able to open this spreadsheet and delete any rows that have a greater time in column A than the current time of the present day.

Any ideas on how this would be done?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Delete rows if time is greater than present time

hi Sabisis,

Private Sub Worksheet_Activate()
Dim i As Long
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If Cells(i, 1) < Now Then Rows(i).Delete Shift:=xlUp
Next
End Sub



isabelle


Le 2012-12-29 15:48, Sabosis a écrit :
Hello-

I have a spreadsheet that has times by 1/2 hour in column A for our workday.


The spreadsheet will always have the full workday of information in it
over the past 4 weeks for the same day (last 4 Mondays, etc).

I want to be able to open this spreadsheet and delete any rows that
have a greater time in column A than the current time of the present day.

Any ideas on how this would be done?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Delete rows if time is greater than present time

On Saturday, December 29, 2012 5:55:12 PM UTC-8, isabelle wrote:
hi Sabisis,



Private Sub Worksheet_Activate()

Dim i As Long

For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1

If Cells(i, 1) < Now Then Rows(i).Delete Shift:=xlUp

Next

End Sub







isabelle





Le 2012-12-29 15:48, Sabosis a écrit :

Hello-




I have a spreadsheet that has times by 1/2 hour in column A for our workday.




The spreadsheet will always have the full workday of information in it

over the past 4 weeks for the same day (last 4 Mondays, etc).



I want to be able to open this spreadsheet and delete any rows that

have a greater time in column A than the current time of the present day.



Any ideas on how this would be done?




Thank you so much!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculate time if greater than a given time draculardw Excel Programming 5 December 10th 08 09:29 AM
How to delete or copy alternative rows/columns at a time? Bhagavan Excel Discussion (Misc queries) 0 May 12th 08 07:31 PM
I have 4000+ rows in a worksheet, how to delete 100's at a time? Renee working on data Excel Worksheet Functions 4 September 12th 07 10:33 PM
Delete rows at the same time from selected worksheets Filo Excel Programming 3 May 5th 07 02:41 PM
Delete same Rows/Columns from two worksheets at a time Vinit[_2_] Excel Programming 2 May 14th 05 04:20 AM


All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"