Consider the following (partial) Excel worksheet:
A | B | C | D
---+-------------+-------+-------
id | date | var_a | var_b
1 | 2011-03-12 | 200 | 34.22
1 | 2011-03-13 | 203 | 35.13
1 | 2011-03-14 | 205 | 34.14
1 | 2011-03-15 | 207 | 54.88
1 | 2011-03-16 | 208 | 12.01
1 | 2011-03-18 | 203 | 76.10
1 | 2011-03-19 | 210 | 14.86
1 | 2011-03-20 | 200 | 25.45
. | . | . | .
. | . | . | .
2 | 2011-03-12 | 200 | 34.22
2 | 2011-03-13 | 203 | 35.13
2 | 2011-03-14 | 205 | 34.14
2 | 2011-03-15 | 207 | 54.88
2 | 2011-03-16 | 208 | 12.01
2 | 2011-03-18 | 203 | 76.10
2 | 2011-03-19 | 210 | 14.86
2 | 2011-03-20 | 200 | 25.45
. | . | . | .
. | . | . | .
In reality, there are over 5.000 rows. I need to delete all rows which date falls on a saturday or sunday. In the example, March 12 and 13 (2011-03-12/13)
and March 19 and 20 are Saturdays and Sundays. I cannot just delete every nth rows, since there might be days missing in the list (as is the case here with 2011-03-17
).
Is this possible to do with either a formula or VBScript? I have never written a VBScript macro before (I have never had a use for it) so I would appreciate some help.