WaqasTariq
Board Regular
- Joined
- Jun 26, 2012
- Messages
- 58
- Office Version
- 365
Hi,
So I think I have what I need, but it is not working. I am trying to delete all filtered-out rows. (temp1 worksheet is hidden from view) example worksheet: Example.xlsm
So I think I have what I need, but it is not working. I am trying to delete all filtered-out rows. (temp1 worksheet is hidden from view) example worksheet: Example.xlsm
VBA Code:
Option Explicit
Public l_DPI_LastRow1 As Long
Public s_WeekDayNames1() As String
Sub Button1_Click()
WkS_Temp1.Range("A:C").Clear
ReDim s_WeekDayNames1(1 To 7)
s_WeekDayNames1(1) = "Mon"
s_WeekDayNames1(2) = "Tue"
' So on...
l_DPI_LastRow1 = WkS_Input.Cells(Rows.Count, "A").End(xlUp).Row
WkS_Input.Range("A1:C" & l_DPI_LastRow1).Copy
WkS_Temp1.Range("A1" & ":C" & l_DPI_LastRow1).PasteSpecial xlPasteValues
' Delete all rows where cell has a specific value
WkS_Temp1.AutoFilterMode = False
WkS_Temp1.Range("A1:C" & l_DPI_LastRow1).AutoFilter Field:=1, Criteria1:=s_WeekDayNames1(1)
WkS_Temp1.Range("A1:A" & l_DPI_LastRow1).Offset(1).SpecialCells(12).EntireRow.Delete '.ClearContents
WkS_Temp1.AutoFilterMode = False
End Sub