In my code i select excel files to add them to a listbox, I then run some code that will replace a certain cell on all excel files in the list. Everytime it changes a cell in the excel file it will go to the next one in the listbox using
Me.ListBox2.SelectedIndex = Me.ListBox2.SelectedIndex + 1
But when it reaches the end of the list it gives me an error. How can i let my listbox know that it reached the end.
Put a check like this: