So I am pretty sure I know why it is slowing down, and my hope is to find out how to speed it back up without changing the excel table info, and I have no control over changing it.
Works Fine (Good Speed)
Takes time for text to show after typing
I am almost certain that this part is causing it: (Because of how big the range is)
(And I have no control of size of Range so everything I do has to work with what is on hand, I can only control how the Userforms are set up.)
And this one works fine because it has a much lower range to contend with.
Works Fine (Good Speed)
VBA Code:
Private Sub CboOfferCode_Change()
Dim ws As Worksheet
Dim x, dict
Dim i As Long
Dim str As String
Set ws = Sheets("Lists")
x = ws.Range("Offer_Code").Value
Set dict = CreateObject("Scripting.Dictionary")
str = Me.CboOfferCode.Value
If str <> "" Then
For i = 1 To UBound(x, 1)
If InStr(LCase(x(i, 1)), LCase(str)) > 0 Then
dict.Item(x(i, 1)) = ""
End If
Next i
Me.CboOfferCode.List = dict.keys
Else
Me.CboOfferCode.List = x
End If
Me.CboOfferCode.DropDown
Worksheets("Prom Codes").Range("H2") = Me.CboOfferCode.Value
With Sheets("Prom Codes")
.Range("A1:E507").AutoFilter Field:=1, Criteria1:=.Range("H2").Value
End With
CommandButton12.Enabled = True
End Sub
Takes time for text to show after typing
VBA Code:
Private Sub CboItem_Change()
Dim ws As Worksheet
Dim x, dict
Dim i As Long
Dim str As String
Set ws = Sheets("Lists")
x = ws.Range("Item").Value
Set dict = CreateObject("Scripting.Dictionary")
str = Me.CboItem.Value
If str <> "" Then
For i = 1 To UBound(x, 1)
If InStr(LCase(x(i, 1)), LCase(str)) > 0 Then
dict.Item(x(i, 1)) = ""
End If
Next i
Me.CboItem.List = dict.keys
Else
Me.CboItem.List = x
End If
Me.CboItem.DropDown
Worksheets("Rates").Range("N24") = Me.CboItem.Value
With Sheets("Rates")
.Range("A1:L280242").AutoFilter Field:=2, Criteria1:=.Range("N24").Value
End With
CboTerm.Enabled = True
End Sub
I am almost certain that this part is causing it: (Because of how big the range is)
(And I have no control of size of Range so everything I do has to work with what is on hand, I can only control how the Userforms are set up.)
VBA Code:
With Sheets("Rates")
.Range("A1:L280242").AutoFilter Field:=2, Criteria1:=.Range("N24").Value
End With
And this one works fine because it has a much lower range to contend with.
VBA Code:
With Sheets("Prom Codes")
.Range("A1:E507").AutoFilter Field:=1, Criteria1:=.Range("H2").Value
End With