#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default POP up Box

I am looking to create a simple POP up box that would appear if a
value in cell T10 = Error. Along with a message "Both Values do not
agree". Then just an OK button, once pressed would return the cursor
back to cell B5

The value in T10 is dependent on what the user inputs in to cell B5.
Obviously if T10 = "OK" then the POP up should not appear

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default POP up Box

My attempt was this but nothing happens!

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If .Range("T10").Value = "Error" Then
MsgBox "You have not entered the correct Opening value, please
review and re-enter (see previous days closing value)"

Sheets("Figures").Select
Range("B5").Select

Exit Sub
End If

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default POP up Box

Hi

Validation should do it:

Select B5 goto Data Validation Allow: Custom, Formula: =T10="OK"
Enter your message under the Error alert tab.

Well, you do get two buttons OK/Cansel If you press cansel the value entered
is just deleted, if OK then B5 is selected for reentry.

Or you could insert this macro on the code sheet for the desired sheet:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$5" Then
If Range("T10").Value = "Error" Then
Msg = MsgBox("Both Values do not agree", vbOKOnly)
Target.Select
End If
End If
End Sub

Regards,
Per



"Seanie" skrev i meddelelsen
...
I am looking to create a simple POP up box that would appear if a
value in cell T10 = Error. Along with a message "Both Values do not
agree". Then just an OK button, once pressed would return the cursor
back to cell B5

The value in T10 is dependent on what the user inputs in to cell B5.
Obviously if T10 = "OK" then the POP up should not appear

Thanks


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



All times are GMT +1. The time now is 03:05 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"