无法让我的macros识别单元格的值

在下面的脚本中,它会扫描一个表格,并将拉取值,删除不符合列“M”中设置标准的值。 如果我使标准固定下来(在下面的“MIGS不可用”中),但是如果我尝试将其返回到单元格(AI1)作为标准,则可以使其工作,但要么拉取每个logging,要么拉出任何一个logging。

你的帮助,请允许它看到单元格中的值作为脚本中的标准!

Sub QuickCombine_MIGS() Dim ws1 As Worksheet Dim ws2 As Worksheet Dim rng1 As Range Dim strShts() Dim strWs As Variant Dim lngCalc As Long With Application .ScreenUpdating = False lngCalc = .Calculation .Calculation = xlCalculationManual End With Set ws1 = Sheets("MIGS-Datasheet") ws1.UsedRange.Cells.Clear strsub = Sheets("MIGS").Range("AI2").Value strsub2 = Sheets("MIGS").Range("AI1").Value strShts = Array(strsub) For Each strWs In strShts On Error Resume Next Set ws2 = Sheets(strWs) On Error GoTo 0 If Not ws2 Is Nothing Then Set rng1 = ws2.Range(ws2.[v8], ws2.Cells(Rows.Count, "v").End(xlUp)) rng1.EntireRow.Copy ws1.Cells(ws1.Cells(Rows.Count, "v").End(xlUp).Offset(1, 0).Row, "A") End If Set ws2 = Nothing Next With ws1 .[v1] = "dummy" .Columns("M").AutoFilter Field:=1, Criteria1:="<>MIGS Unavailable" .Rows.Delete .Rows("1").Insert End With With Application .ScreenUpdating = True .Calculation = lngCalc End With End Sub