Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Message box trigger?

Hi.

Is there any way to incorporate a message box alert when a certain
phrase is typed?

For example:

If the word "rekey" is typed in column D, a stop alert will pop up and
say "please provide more detailed info...".

I need the word "rekey" not to remain after the alert is triggered.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Message box trigger?

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "D:D" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Value = "ReKey" Then
MsgBox "please provide more detailed info..."
.Value = ""
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"J.W. Aldridge" wrote in message
ps.com...
Hi.

Is there any way to incorporate a message box alert when a certain
phrase is typed?

For example:

If the word "rekey" is typed in column D, a stop alert will pop up and
say "please provide more detailed info...".

I need the word "rekey" not to remain after the alert is triggered.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Message box trigger?

THANX!


Any way to make that non-case sensitive?

(currently searches for ReKey in this tense only).






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Message box trigger?

Hi

You can use Ucase or Lcase

If LCase(.Value) = "rekey" Then



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"J.W. Aldridge" wrote in message ups.com...
THANX!


Any way to make that non-case sensitive?

(currently searches for ReKey in this tense only).






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
Trigger or code Curt Excel Discussion (Misc queries) 0 April 20th 07 03:32 PM
trigger help climax Excel Worksheet Functions 1 February 2nd 06 04:39 PM
trigger problem climax Excel Discussion (Misc queries) 1 February 2nd 06 12:39 AM
Another way to trigger a macro? Leon[_5_] Excel Programming 1 December 22nd 05 06:03 AM
Event Trigger lobo Excel Programming 5 December 16th 05 08:33 PM


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