Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default A msgbox appears on sheet level once, and only once

I want to put a note by Worksheet_SelectionChange on a worksheet, like
msgbox, to warn the users when they activate that sheet.

But I want that note appears only once, that is, the first time after
the workbook is open and the worksheet is clicked. I do not want to see
that every time the user returns the that worksheet, he is annoyed.

Any ideas?

Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default A msgbox appears on sheet level once, and only once

add a variable on modul level then
in workbooks open event set its value that would store info about msgbox
appearence (e.g. string variable set to "N") - after selection you will
check wheather this value is set to "N" - if so the msg appear and the value
of that variable would be changed to "Y"


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default A msgbox appears on sheet level once, and only once

Same basic idea as Snake, but I would declare a Boolean (true/false) variable
in the code module for the sheet in question, and I would use the
Worksheet_Activate event rather than Worksheet_SelectionChange.

Dim BeenHere As Boolean

Private Sub Worksheet_Activate()
If IsNull(BeenHere) Then
BeenHere = False
End If
If BeenHere = False Then
MsgBox "First time"
BeenHere = True
End If
End Sub

Hope this helps,

Hutch

"Snake Plissken" wrote:

add a variable on modul level then
in workbooks open event set its value that would store info about msgbox
appearence (e.g. string variable set to "N") - after selection you will
check wheather this value is set to "N" - if so the msg appear and the value
of that variable would be changed to "Y"



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
INDIRECT with Sheet Level Defined Name NickH Excel Worksheet Functions 2 June 22nd 11 06:07 PM
unprotect a sheet that appears to be unprotected already TamsinL Excel Worksheet Functions 3 December 9th 06 10:28 AM
If a worksheet name is = to test then a msgbox appears Vick Excel Discussion (Misc queries) 1 December 21st 05 11:17 PM
Unwanted bar appears at the top of the sheet Mark Stephens[_3_] Excel Programming 3 May 1st 05 06:34 AM
Why, when I create workbook-level name does it jump it to Sheet-level ? Charles Jordan Excel Programming 1 November 5th 03 08:43 PM


All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"