fredrerik84
Active Member
- Joined
- Feb 26, 2017
- Messages
- 383
Hi guys im trying to set my entire worksheet into an array , loop trough the rows/columns and set this data into 2nd array vResult if the date is not over. then the plan is to delete the cells with the first arr and insert the 2nd
Here is what I got, but Im having some problem with the Vresult variant ::/
im stuck not able to set the vResult , any help with this would be great..
Here is what I got, but Im having some problem with the Vresult variant ::/
Rich (BB code):
Sub RemovePassedDate()
Dim Lrow, i, j, k, c As Long
Dim str As String
Dim Vdata, vResult As Variant
Dim sheet As Worksheet
Set sheet = ActiveWorkbook.Sheets("Matches")
Lrow = sheet.Cells(Rows.Count, "B").End(xlUp).Row
j = 1
Vdata = sheet.Range("A12:Z" & Lrow)
For i = LBound(Vdata, 1) To UBound(Vdata, 1)
If Vdata(i, 1) > Now Then
For c = 1 To UBound(Vdata, 2)
ReDim Preserve vResult(j To UBound(vResult) + 1) As String
vResult(j, c) = Vdata(i, c)
Next c
End If
j = j + 1
Next i
Set Vdata = Nothing
End Sub
im stuck not able to set the vResult , any help with this would be great..
Last edited by a moderator: