VBA-进行关键字搜索后列表框显示网格线

VBA-进行关键字搜索后列表框显示网格线

我的列表框工作正常,但当我进行单词搜索时(下面的屏幕截图),会出现一些网格线?为什么?我该如何摆脱网格线?有时,即使我清除搜索并重新填充列表框,这些网格线仍会出现。很奇怪!有人遇到过这个问题吗?

Private Sub SetupHoliday_Click()
     On Error Resume Next
     For i = 0 To AppliedYearListbox.ListCount - 1
          If AppliedYearListbox.Selected(i) = True Then
             dateButton = "Date_" & Format(AppliedYearListbox.List(i), "yyyy") & "_" & Format(AppliedYearListbox.List(i), "m") & "_" & Format(AppliedYearListbox.List(i), "d")
             Set foundCell = rangeSearchDate.Find(what:=dateButton, lookat:=xlWhole, MatchCase:=False, searchformat:=False)
             foundRow = foundCell.Row
             Sheets("Background").Range("AF" & foundRow).Value = "Holiday"
             DoEvents
             AppliedYearListbox.Selected(i) = False
          End If
     Next i
End Sub

在此处输入图片描述

相关内容