I writing a loop to load a userform if certain criteria are met, but I want to be able to just print the form and close it, then move onto the next item in the loop.
The problem is that the userform waits for me to click on either "ok" or "cancel" before it moves onto the next step. My code is below.
Dim myFirst As Object
Set myFirst = ActiveDocument.CustomDocumentProperties
Dim CurrentItem As ListItem
Dim CurrentSubItem As ListView
For Each CurrentItem In StockList.ListView1.ListItems
Dim dToday, DHolding As Date
Dim ddiff As Long
DHolding = CurrentItem.SubItems(2)
dToday = Date
ddiff = DateDiff("d", dToday, DHolding)
If ddiff < 3 Then
myFirst.item("xListItem").Value = CurrentItem.Index
CurrentItem.Bold = True
CurrentItem.Bold = False