View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Remove rows in huge data array

Try this:

Sub noweekend()
Dim n As Long, d As Date
n = Cells(Rows.Count, 1).End(xlUp).Row
For i = n To 1 Step -1
d = Cells(i, 1).Value
dayIs = Format(d, "ddd")
If dayIs = "Sat" Or dayIs = "Sun" Then
Cells(i, 1).EntireRow.Delete
End If
Next
End Sub

This assumes that the values are "real" dates.
--
Gary''s Student - gsnu200830


"Artem" wrote:

Hi,

I need some help with VBA programming. I have a huge array with financial
data: daily data for 7 last years. The first column (A:A) in the array is
dates in format dd.mm.yyyy, next few columns contains different data. What I
need is to go through dates, find weekends and delete rows with weekends (not
just clear content of rows but delete/cut them).

Thanks in advance!