Thread
: [Solved]
Unexpected Macro Behavior
View Single Post
03-30-2018, 04:28 AM
gmayor
Windows 10
Office 2016
Expert
Join Date: Aug 2014
Posts: 4,142
Run the loop in reverse so as not to screw up the count
Code:
For i = myTrash.Items.Count to 1 step -1 myTrash.Items(i).Delete Next i
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes
www.gmayor.com
gmayor
View Public Profile
Find all posts by gmayor