LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default userform to remove from view

Try this:

Public Sub test()

Dim MsgForm As UserForm1
Static nResult As Long


Set MsgForm = New UserForm1

If nResult < 1 Then
Load MsgForm

With MsgForm
.Label = "My Prompt"
.Show
nResult = .Result
End With
End If

Unload MsgForm

Set MsgForm = Nothing

Select Case nResult
Case -1
'Do "Yes" stuff
Case 0
'Do "No" stuff
Case 1
'Do "Yes to all" stuff
End Select

End Sub

At some point (in the procedure you're calling test from), you're going to
want to reset nResult, otherwise the program will never prompt the user
again- until the workbook is closed. So make sure you do this.

--
Chris Farkas
Excel/Access Developer
www.eAlchemy.biz

 
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
Remove Email View on spreadsheet JICDB Excel Discussion (Misc queries) 1 August 25th 08 04:21 PM
how to remove e-mail view Teranews Excel Discussion (Misc queries) 2 April 5th 08 08:09 PM
How do I remove Watermark from View. Melody Excel Discussion (Misc queries) 2 February 21st 08 07:49 PM
remove view format Gina_Louisville Excel Discussion (Misc queries) 2 November 9th 06 04:45 PM
View only UserForm? Claud Balls Excel Programming 4 January 5th 05 05:13 AM


All times are GMT +1. The time now is 04:00 AM.

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"