#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Macro maybe?

In Col. A there are dates, formatted as dates in the format of Sun - Jan 01,
2010 and it goes to the end of 2010. How do I delete all the Saturday and
Sunday's in one shot? Connie
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default Macro maybe?

Format the column as Special/ ddd, filter, custom, equals Saturday or equals
Sunday, delete rows.

"Connie Martin" wrote:

In Col. A there are dates, formatted as dates in the format of Sun - Jan 01,
2010 and it goes to the end of 2010. How do I delete all the Saturday and
Sunday's in one shot? Connie

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Macro maybe?

Here is a non macro solution. Change the format of your dates to a custom
format of dddd. Now all of your dates will be the days of the week. Sunday,
Monday, ...

Data | Filter | Auto Filter
Filter for Saturday.
Select the visible rows and delete.
Do the same for Sunday
Change the date formats back and remove the autofilter.
--
HTH...

Jim Thomlinson


"Connie Martin" wrote:

In Col. A there are dates, formatted as dates in the format of Sun - Jan 01,
2010 and it goes to the end of 2010. How do I delete all the Saturday and
Sunday's in one shot? Connie

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Macro maybe?

Sub deletesatsun()
Dim md As String
For i = Cells(Rows.Count, 1) _
..End(xlUp).Row To 1 Step -1
md = Left(Format(Cells(i, 1), "ddd"), 3)
If md = "Sat" Or md = "Sun" Then
Rows(i).Delete 'MsgBox i
End If
Next i
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Connie Martin" wrote in message
...
In Col. A there are dates, formatted as dates in the format of Sun - Jan
01,
2010 and it goes to the end of 2010. How do I delete all the Saturday and
Sunday's in one shot? Connie


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Macro maybe?

Thank you! You and Jim had the same answer and it works wonderfully. I had
looked at that aspect but didn't know it would retain my original dates when
I reformatted it. I should've tried it. I actually hadn't thought of using
the filter. I was just trying to get them in alphabetical order so I could
delete all the Saturaday & Sunday rows manually, but the filter was much
quicker. Thanks again. Connie

"Sean Timmons" wrote:

Format the column as Special/ ddd, filter, custom, equals Saturday or equals
Sunday, delete rows.

"Connie Martin" wrote:

In Col. A there are dates, formatted as dates in the format of Sun - Jan 01,
2010 and it goes to the end of 2010. How do I delete all the Saturday and
Sunday's in one shot? Connie



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Macro maybe?

Thank you, Jim. You and Sean had the same answer. You'll see my response to
him. I am printing this post for future reference, as I always do. Thanks
again. Connie

"Jim Thomlinson" wrote:

Here is a non macro solution. Change the format of your dates to a custom
format of dddd. Now all of your dates will be the days of the week. Sunday,
Monday, ...

Data | Filter | Auto Filter
Filter for Saturday.
Select the visible rows and delete.
Do the same for Sunday
Change the date formats back and remove the autofilter.
--
HTH...

Jim Thomlinson


"Connie Martin" wrote:

In Col. A there are dates, formatted as dates in the format of Sun - Jan 01,
2010 and it goes to the end of 2010. How do I delete all the Saturday and
Sunday's in one shot? Connie

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Macro maybe?

Don, I tried the macro as well as Jim and Sean's method, which work. I am
having a Compile Syntax error message with the macro, and the rows it's
highlighting a
For i = Cells(Rows.Count, 1) _
...End(xlUp).Row To 1 Step -1
Anyway, since it can be done without a macro, I think I'll take that route.
Thank you for responding. Much appreciated. Connie

"Don Guillett" wrote:

Sub deletesatsun()
Dim md As String
For i = Cells(Rows.Count, 1) _
..End(xlUp).Row To 1 Step -1
md = Left(Format(Cells(i, 1), "ddd"), 3)
If md = "Sat" Or md = "Sun" Then
Rows(i).Delete 'MsgBox i
End If
Next i
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Connie Martin" wrote in message
...
In Col. A there are dates, formatted as dates in the format of Sun - Jan
01,
2010 and it goes to the end of 2010. How do I delete all the Saturday and
Sunday's in one shot? Connie


.

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Macro maybe?

1st line
application.screenupdating=false
last line
application.screenupdating=true

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Connie Martin" wrote in message
...
Okay, this works now! Thank you. It's rather neat looking at the screen
"shaking" as it goes through the column removing the weekends! I'd shake,
too, if the weekends were removed from me! Ha! Thanks, Don. Another one
to
print. Connie

"Don Guillett" wrote:

Was tested. somehow an EXTRA . in front of END. change to ONE dot.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Connie Martin" wrote in message
...
Don, I tried the macro as well as Jim and Sean's method, which work. I
am
having a Compile Syntax error message with the macro, and the rows it's
highlighting a
For i = Cells(Rows.Count, 1) _
..End(xlUp).Row To 1 Step -1
Anyway, since it can be done without a macro, I think I'll take that
route.
Thank you for responding. Much appreciated. Connie

"Don Guillett" wrote:

Sub deletesatsun()
Dim md As String
For i = Cells(Rows.Count, 1) _
..End(xlUp).Row To 1 Step -1
md = Left(Format(Cells(i, 1), "ddd"), 3)
If md = "Sat" Or md = "Sun" Then
Rows(i).Delete 'MsgBox i
End If
Next i
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Connie Martin" wrote in
message
...
In Col. A there are dates, formatted as dates in the format of Sun -
Jan
01,
2010 and it goes to the end of 2010. How do I delete all the
Saturday
and
Sunday's in one shot? Connie

.


.


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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM


All times are GMT +1. The time now is 03:38 AM.

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

About Us

"It's about Microsoft Excel"