This code determines what version of the code is run biased on the step
My issue is when the form starts the first time it loads correctly but the second time around when the code is run it starts correct but if i relaunch the form it doesn't
what do i need to do to get it to load right
VBA Code:
Private Sub UserForm_Activate()
iStepCurrent = NightAuditP.iStepCurrent
'iStepCurrent = 6
Select Case iStepCurrent
Case 6 Or 7
Call CK1
Case 15 Or 16
Call Me.CK2
End Select
If Me.ListBox1.ListCount > 0 Then
Me.Cleared.Enabled = False
End If
End Sub
VBA Code:
Sub CK2()
Dim DirectoryListArray As Variant, sPath As String
Dim rg As Range, i As Long, j As Long
sPath = "G:\Shared drives\437 - HIE Malvern - All Users\Front desk\Night Audit\Audit Reports\Disembodied\" & Format(Date - 1, "MM-DD-YYYY") + "\"
DirectoryListArray = GetFiles(sPath)
Set rg = Worksheets("Data List").Cells(1, 1).CurrentRegion
Set ufDic = CreateObject("Scripting.Dictionary")
For j = 2 To rg.Rows.Count
If Not rg.Cells(j, 7) = vbNullString Then
If UBound(Filter(DirectoryListArray, rg.Cells(j, 7), 1, 1)) < 0 Then
ufDic.Item(rg.Cells(j, 3).Value) = rg.Cells(j, 8).Value
End If
End If
Next j
Me.ListBox1.List = ufDic.Keys 'Adapt to your needs
Me.Show
End Sub
what do i need to do to get it to load right