Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
mjm
 
Posts: n/a
Default Is there a way to force a pop up when spreadsheet is open?

I often get the pop-up "Do you want to enable macros?" when I open a
spreadsheet. I would like to create one that says "I have added a new tab to
the spreadsheet". How do I create a pop-up that appears when a spreadsheet is
open?
  #2   Report Post  
Posted to microsoft.public.excel.misc
mrice
 
Posts: n/a
Default Is there a way to force a pop up when spreadsheet is open?


You need to create a macro linked to the workbook_open event on the
workbooks VBA tab to flash up the message box.

Private Sub Workbook_Open()
MsgBox "Hello"
End Sub


--
mrice


------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=533859

  #3   Report Post  
Posted to microsoft.public.excel.misc
Therese
 
Posts: n/a
Default Is there a way to force a pop up when spreadsheet is open?

Hi
You can also go to dat<datavalid and proceed from there, that's what I'd do.
Hey
--
Therese


"mjm" skrev:

I often get the pop-up "Do you want to enable macros?" when I open a
spreadsheet. I would like to create one that says "I have added a new tab to
the spreadsheet". How do I create a pop-up that appears when a spreadsheet is
open?

  #4   Report Post  
Posted to microsoft.public.excel.misc
DCSwearingen
 
Posts: n/a
Default Is there a way to force a pop up when spreadsheet is open?


This may not be as efficient and as elegant as possible, but it works.

*~*~*~*~*~*~*~*~*~
Global nSheets As Integer

'Run one time to initialize the original count of sheets.
Sub InitializeCount()
Dim sh As Object, shCount As Integer
shCount = 0
For Each sh In ActiveWorkbook.Sheets
shCount = shCount + 1
Next sh
ActiveWorkbook.Names.Add Name:="myCount", RefersToR1C1:=shCount
End Sub

Sub Auto_Open()
Dim myNum, myValue As Integer
myNum = ActiveWorkbook.Names("myCount").Value
myValue = Right(myNum, 1)
CountSheets
If nSheets myValue Then
newSheetMessage
ActiveWorkbook.Names.Add Name:="myCount",
RefersToR1C1:=nSheets
End If
End Sub

Sub CountSheets()
Dim sh As Object
nSheets = 0
For Each sh In ActiveWorkbook.Sheets
nSheets = nSheets + 1
Next sh
End Sub

Sub newSheetMessage()
Msg = "A new sheet has been added."
Style = vbOKOnly + vbExclamation
Title = "Important Information"
Response = MsgBox(Msg, Style, Title)
End Sub


--
DCSwearingen


------------------------------------------------------------------------
DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506
View this thread: http://www.excelforum.com/showthread...hreadid=533859

  #5   Report Post  
Posted to microsoft.public.excel.misc
DCSwearingen
 
Posts: n/a
Default Is there a way to force a pop up when spreadsheet is open?


I just noticed that my proposed solution will only work if there are
less than 10 worksheets due to only using the right most character.

Try this instead.

*~*~*~*~*~*~*~*~*~

Global nSheets As Integer

'Run one time to initialize the original count of sheets.
Sub InitializeCount()
Dim sh As Object, shCount As Integer
shCount = 0
For Each sh In ActiveWorkbook.Sheets
shCount = shCount + 1
Next sh
ActiveWorkbook.Names.Add Name:="myCount", RefersToR1C1:=shCount
End Sub

Sub Auto_Open()
Dim myNum, myValue As Integer, myLen As Integer
myNum = ActiveWorkbook.Names("myCount").Value
myLen = Len(myNum)
myNum = Right(myNum, myLen - 1)
CountSheets
If nSheets myValue Then
newSheetMessage
ActiveWorkbook.Names.Add Name:="myCount", RefersToR1C1:=nSheets
End If
End Sub

Sub CountSheets()
Dim sh As Object
nSheets = 0
For Each sh In ActiveWorkbook.Sheets
nSheets = nSheets + 1
Next sh
End Sub

Sub newSheetMessage()
Msg = "A new sheet has been added."
Style = vbOKOnly + vbExclamation
Title = "Important Information"
Response = MsgBox(Msg, Style, Title)
End Sub


--
DCSwearingen


------------------------------------------------------------------------
DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506
View this thread: http://www.excelforum.com/showthread...hreadid=533859



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
Can you open a new spreadsheet in a new program window? 3R''s Excel Discussion (Misc queries) 3 November 10th 05 12:59 AM
#NAME when I open up my spreadsheet Muttley Excel Worksheet Functions 2 October 21st 05 01:20 PM
How do I automatically open a spreadsheet in a specific worksheet? GT Excel Discussion (Misc queries) 1 September 2nd 05 07:25 PM
Why doesn't the spreadsheet file open. Piato Excel Discussion (Misc queries) 1 July 4th 05 09:05 PM
windows explorer will not open an excel spreadsheet. hal Excel Discussion (Misc queries) 2 June 24th 05 02:07 AM


All times are GMT +1. The time now is 08:07 PM.

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

About Us

"It's about Microsoft Excel"