Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Bastet Massri   on Jan 29 In MS Office Category.

  
Question Answered By: Luigi Fischer   on Jan 29

You can put a variable at the top of your module (i.e. before the
subroutine) and set it to indicate that the question has been asked, and
answered. Then only ask the question if that variable isn't set. That
variable should then stay set for the remainder of the session.

However, I'd also suggest a different structure for your subroutine, to make
it easier to do the rest.

Instead of asking if the answer is yes (variable "a"), ask if it is no. If
it is no, do an immediate Exit Sub.

That way you can take the If away from your For statement - simply do it
every time, provided the subroutine wasn't exited early by the Exit Sub.
Then you can surround the MsgBox call and the If inside another If that
causes it only to be asked once.

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Messabe Box to appear once Or get search suggestion and latest updates.


Tagged: