ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Prompting users with a message box on certain cells (https://www.excelbanter.com/excel-worksheet-functions/218434-prompting-users-message-box-certain-cells.html)

tommy

Prompting users with a message box on certain cells
 
I am looking for a macro to do the following:

As soon as a User clicks on cells B18 or B24 or B37

a message box should pop up with my message (I already have the message code)

I just need the code to tell it when a user selects one of the above
mentioned cells

--
thanx

Max

Prompting users with a message box on certain cells
 
One easy alternative for the desired functionality is via:
Data Validation Input message tab
The message will display when the cell is selected
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---
"tommy" wrote:
I am looking for a macro to do the following:

As soon as a User clicks on cells B18 or B24 or B37

a message box should pop up with my message (I already have the message code)

I just need the code to tell it when a user selects one of the above
mentioned cells



John[_22_]

Prompting users with a message box on certain cells
 
Hi Tommy
Did you know you can get the same result with DataValidation
goto Input message and type your message. Also you got InsertComment.
Without a Macro
HTH
John

"tommy" .(donotspam) wrote in message
...
I am looking for a macro to do the following:

As soon as a User clicks on cells B18 or B24 or B37

a message box should pop up with my message (I already have the message
code)

I just need the code to tell it when a user selects one of the above
mentioned cells

--
thanx



tommy

Prompting users with a message box on certain cells
 
To All,
I'm sorry
I forgot to mention that Data Validation is not an option since I am already
using it as a drop down list on the mentioned cells
--
thanx


"Max" wrote:

One easy alternative for the desired functionality is via:
Data Validation Input message tab
The message will display when the cell is selected
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---
"tommy" wrote:
I am looking for a macro to do the following:

As soon as a User clicks on cells B18 or B24 or B37

a message box should pop up with my message (I already have the message code)

I just need the code to tell it when a user selects one of the above
mentioned cells



tommy

Prompting users with a message box on certain cells
 
Sorry,
but I dont want to use Insert Comment or Data Validation

I want the message box to pop up since it forces the user to read and click OK
--
thanx


"John" wrote:

Hi Tommy
Did you know you can get the same result with DataValidation
goto Input message and type your message. Also you got InsertComment.
Without a Macro
HTH
John

"tommy" .(donotspam) wrote in message
...
I am looking for a macro to do the following:

As soon as a User clicks on cells B18 or B24 or B37

a message box should pop up with my message (I already have the message
code)

I just need the code to tell it when a user selects one of the above
mentioned cells

--
thanx




Gord Dibben

Prompting users with a message box on certain cells
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const sINPUTS As String = "B18,B24,B37"
If Not Intersect(Target, Me.Range(sINPUTS)) Is Nothing Then
MsgBox "your message"
End If
End Sub

Right-click on the sheet tab and "View Code". Copy/paste into that module.

Alt + q to return to the Excel window.


Gord Dibben MS Excel MVP

On Thu, 29 Jan 2009 16:49:01 -0800, tommy
.(donotspam) wrote:

Sorry,
but I dont want to use Insert Comment or Data Validation

I want the message box to pop up since it forces the user to read and click OK



tommy

Prompting users with a message box on certain cells
 
thanx, this worked

BUT, I need a total of 31 lines/sentences to complete my message

the last 7 lines are on the same line as the 7 previous lines

how do I extend the message box
--
thanx


"Gord Dibben" wrote:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const sINPUTS As String = "B18,B24,B37"
If Not Intersect(Target, Me.Range(sINPUTS)) Is Nothing Then
MsgBox "your message"
End If
End Sub

Right-click on the sheet tab and "View Code". Copy/paste into that module.

Alt + q to return to the Excel window.


Gord Dibben MS Excel MVP

On Thu, 29 Jan 2009 16:49:01 -0800, tommy
.(donotspam) wrote:

Sorry,
but I dont want to use Insert Comment or Data Validation

I want the message box to pop up since it forces the user to read and click OK




Gord Dibben

Prompting users with a message box on certain cells
 
What happened to....................?

" (I already have the message code) "

I suppose you could add a bunch of linefeeds like

MsgBox "this is the first line of the message" & vbCrLf _
& "this is the second line of the message" & vbCrLf _
& "this is the third line" etc.

Would be far easier to place the message in a textbox on a UserForm which
loads when the correct cell(s) are selected.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const sINPUTS As String = "B18,B24,B37"
If Not Intersect(Target, Me.Range(sINPUTS)) Is Nothing Then
UserForm1.Show
End If
End Sub

Users read the message then hit the close "x" on the UserForm


Gord

On Thu, 29 Jan 2009 18:07:01 -0800, tommy
.(donotspam) wrote:

thanx, this worked

BUT, I need a total of 31 lines/sentences to complete my message

the last 7 lines are on the same line as the 7 previous lines

how do I extend the message box




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com