Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Stuck myself - can't bring back very hidden

It doesn't work because the only thing the msgbox can return is vbOK and he
is checking for vbYes

MsgBox("Click to View Data", vbOKOnly) = vbYes

But if the user can only return vbOK, then why even bother to check

MsgBox "Click to View Data", vbOKOnly

Sheets("Sheet1").Visible = True

Sheets("Sheet1").Activate

Sheets("Sheet3").Visible = False


Would function the same.

Regards,
Tom Ogilvy




"Tim" wrote in message
...
Ed,

Try replacing the code that starts with, "If MsgBox" with this:

Dim Ans As Integer
Ans = MsgBox("Click to View Data", vbOKOnly)
If Ans = 1 Then
Sheets("Sheet1").Visible = True
Sheets("Sheet1").Activate
Sheets("Sheet3").Visible = False
End If

I don't know why your code doesn't work (it wouldn't for me either).
Someone brighter than I can probably answer off the top of their head.

Tim

"Ed" wrote in message
...
I have the following code:



Private Sub Workbook_Open()

If ActiveWorkbook.ReadOnly = False Then

ThisWorkbook.Saved = True

ThisWorkbook.ChangeFileAccess xlReadOnly

End If



Worksheets("Sheet1").Visible = xlVeryHidden

Worksheets("TIRs").Visible = xlVeryHidden



If MsgBox("Click to View Data", vbOKOnly) = vbYes Then

Sheets("Sheet1").Visible = True

Sheets("Sheet1").Activate

Sheets("Sheet3").Visible = False

End If



End Sub



The message box pops up, but nothing happens when I click the Yes button

on
the message box.



What did I do wrong?



Ed






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Stuck myself - can't bring back very hidden

"Tom Ogilvy" wrote in message
...
It doesn't work because the only thing the msgbox can return is vbOK and

he
is checking for vbYes

MsgBox("Click to View Data", vbOKOnly) = vbYes


Thanks, Tom. Maybe I ought to leave off learning programming for a while
and figure out how to proof-read!! *sigh*

Ed


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
Bring Back DBF! The GIS Industry uses it! Jobhater Excel Discussion (Misc queries) 6 June 9th 10 07:57 PM
Bring back .dbf in Excel Laura Excel Discussion (Misc queries) 11 July 13th 09 10:20 PM
Bring Back Qualified Sum from another WB Excel Worksheet Functions 4 April 8th 05 01:01 AM
Bring back the old help format! John Przybylski Excel Worksheet Functions 2 April 5th 05 06:24 PM
Stuck myself - can't bring back "VeryHidden" Ed[_9_] Excel Programming 3 July 22nd 03 03:42 AM


All times are GMT +1. The time now is 11:39 AM.

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"