Hi
For some reason, the below code don't work. It shows the error message even when all my filtered rows =base
Thank you
For some reason, the below code don't work. It shows the error message even when all my filtered rows =base
Thank you
Code:
Option Explicit
Sub Macro1()
'
' Macro1 Macro
'
'
Dim base As Integer
Dim c As Range
base = InputBox("State base")
ActiveWorkbook.ActiveSheet.Range("A:W").AutoFilter Field:=11, Criteria1:="<>" & 2 * base
For Each c In ActiveWorkbook.ActiveSheet.Range("K:K").SpecialCells(xlCellTypeVisible)
If c.Value <> base Then
Cells(1, 1000) = "ERROR"
MsgBox "There is an error with the SubTotal. Please change manually."
Exit For
End If
Next
End Sub
Last edited by a moderator: