我有一张评估表。在表中,我必须寻找S,T和U三列。将公式转换成vba
如果列S包含无效并且列T和U都填满了,那么我需要筛选整行。
为此,我尝试了下面的代码。该代码适用于我。但对于我的其他同事来说,过滤器根据条件不起作用。
列Z被视为辅助列,根据条件标记为真或假。如果列T和U都填满并且S无效,那么它标记为false,其余为真
我已经在所有模块之上显式使用了选项。
任何人都可以提出,我怎么能克服这个?任何一个可以帮助我的代码,而无需使用公式
Sub fc()
Dim totalrows As Long
Dim sformula
totalrows = Range("A5").End(xlDown).Row
With Sheets("Evaluation").Range("Z5:Z" & totalrows)
' if the S5 is not equal to invalid and any one of the column T and U are filled, then activate autofilter
sformula = "=AND(S5<>""Invalid"",OR(ISBLANK(T5),ISBLANK(U5)))"
.Formula = sformula
.AutoFilter 26, True
.Value = .Value
End With
End Sub
只要将.Value = .Value移动到自动筛选器上并检查。 – Sixthsense
@Sixthsense有没有其他方法?我试图与它合作 – Jenny