mercredi 16 juin 2021

I want pop up msg when condition doesn't met in nested if-else and for loop using VBA

I am applying some conditions using the 'if else' loop for all the entries in the spreadsheet using the 'For' loop.

As a last condition I want to see if the required file number does not exist in the file, it should print some error msg.

  1. if I put it as an 'else condition' it pops up again and again when it loops through each entry in the spreadsheet due to 'For' loop.

  2. if I use 'exit for' statement, then it exits the loop just after looking into first entry

  3. If I try to code it outside the for loop, then it pops up even though we get data for the search box.

I know I am missing some silly trick.

enter image description here

Aucun commentaire:

Enregistrer un commentaire