ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   formula or code (https://www.excelbanter.com/excel-worksheet-functions/8236-formula-code.html)

Monty

formula or code
 
if i wanted a message to appear on screen (saying please issue prompt payment
letter)if a certain number in a cell was over 15.
how would i go about this.
i am a novice at this any help please.
thanks.



Nick Hodge

Monty

If you can set up a formula next to the cell then you could use an IF
function, like

=IF(CellWith15In<15,"","Issue Prompt Payment Letter")

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Monty" wrote in message
...
if i wanted a message to appear on screen (saying please issue prompt
payment
letter)if a certain number in a cell was over 15.
how would i go about this.
i am a novice at this any help please.
thanks.





JE McGimpsey

One way:

=IF(G415,"Please Issue Prompt Payment Letter", "")

If you want a message box instead, use

=IF(G415,PromptPayment(),"")

with this UDF in a regular code module:

Public Function PromptPayment()
MsgBox "Please issue Prompt Payment Letter"
End Function

If you're unfamiliar with UDFs, see David McRitchie's "Getting Started
with Macros and User Defined Functions":

http://www.mvps.org/dmcritchie/excel/getstarted.htm



In article ,
"Monty" wrote:

if i wanted a message to appear on screen (saying please issue prompt payment
letter)if a certain number in a cell was over 15.
how would i go about this.
i am a novice at this any help please.


Monty

Thanks for this
but can i ask you another point.

If i had the followinig formula in box G4 =DAYS360(E34,F34)and i wanted to
add your message box formula =IF(G415,PromptPayment(),"")to it. how would i
do this.
thanks once again.

"JE McGimpsey" wrote:

One way:

=IF(G415,"Please Issue Prompt Payment Letter", "")

If you want a message box instead, use

=IF(G415,PromptPayment(),"")

with this UDF in a regular code module:

Public Function PromptPayment()
MsgBox "Please issue Prompt Payment Letter"
End Function

If you're unfamiliar with UDFs, see David McRitchie's "Getting Started
with Macros and User Defined Functions":

http://www.mvps.org/dmcritchie/excel/getstarted.htm



In article ,
"Monty" wrote:

if i wanted a message to appear on screen (saying please issue prompt payment
letter)if a certain number in a cell was over 15.
how would i go about this.
i am a novice at this any help please.




Hi

me again

When i put any of these formulas in it comes up with an
circular reference error?? Any ideas.

thanks

-----Original Message-----
One way:

=IF(G415,"Please Issue Prompt Payment Letter", "")

If you want a message box instead, use

=IF(G415,PromptPayment(),"")

with this UDF in a regular code module:

Public Function PromptPayment()
MsgBox "Please issue Prompt Payment Letter"
End Function

If you're unfamiliar with UDFs, see David

McRitchie's "Getting Started
with Macros and User Defined Functions":

http://www.mvps.org/dmcritchie/excel/getstarted.htm



In article <010CA17D-1E0C-460D-A366-

,
"Monty" wrote:

if i wanted a message to appear on screen (saying

please issue prompt payment
letter)if a certain number in a cell was over 15.
how would i go about this.
i am a novice at this any help please.

.


JE McGimpsey

Put them in a cell other than the one you're monitoring...

If G4 has an existing calculation, say,

=SUM(G1:G3)

and you want the message in the cell, use

=IF(SUM(G1:G3)15,"Please issue Prompt Payment Letter", SUM(G1:G3))

If you want a message box, the easiest thing to do is use the
Worksheet_Calculate() event. Put this in your worksheet code module
(right-click the worksheet tab and choose View Code):

Private Sub Worksheet_Calculate()
With Range("G4")
If IsNumeric(.Value) Then _
If .Value 15 Then _
MsgBox "Please Issue Prompt Payment Letter"
End With
End Sub

This will automatically monitor G4 every time the sheet calculates

In article ,
wrote:

When i put any of these formulas in it comes up with an
circular reference error?? Any ideas.


JE McGimpsey

One way:

=IF(DAYS360(E34,F34)15,PromptPayment(),DAYS360(E3 4,F34))




In article ,
"Monty" wrote:

Thanks for this
but can i ask you another point.

If i had the followinig formula in box G4 =DAYS360(E34,F34)and i wanted to
add your message box formula =IF(G415,PromptPayment(),"")to it. how would i
do this.
thanks once again.


Monty

Sorry

If i put this formula =IF(G415,PromptPayment(),"")

with this UDF in a regular code module:

Public Function PromptPayment()
MsgBox "Please issue Prompt Payment Letter"
End Function

it comes up with the following error #NAME?

can anyone please help


" wrote:

Hi

me again

When i put any of these formulas in it comes up with an
circular reference error?? Any ideas.

thanks

-----Original Message-----
One way:

=IF(G415,"Please Issue Prompt Payment Letter", "")

If you want a message box instead, use

=IF(G415,PromptPayment(),"")

with this UDF in a regular code module:

Public Function PromptPayment()
MsgBox "Please issue Prompt Payment Letter"
End Function

If you're unfamiliar with UDFs, see David

McRitchie's "Getting Started
with Macros and User Defined Functions":

http://www.mvps.org/dmcritchie/excel/getstarted.htm



In article <010CA17D-1E0C-460D-A366-

,
"Monty" wrote:

if i wanted a message to appear on screen (saying

please issue prompt payment
letter)if a certain number in a cell was over 15.
how would i go about this.
i am a novice at this any help please.

.



JE McGimpsey

If PromptPayment is stored in the same workbook, or an add-in, it should
be in a regular code module, not a workbook or worksheet class module
(see

http://www.mcgimpsey.com/excel/modules.html

for more).

If PromptPayment() is stored in another workbook (like Personal.xls)
that needs to be referenced, e.g.:

=IF(G415,Personal.xls!PromptPayment(),"")

In article ,
"Monty" wrote:

If i put this formula =IF(G415,PromptPayment(),"")

with this UDF in a regular code module:

Public Function PromptPayment()
MsgBox "Please issue Prompt Payment Letter"
End Function

it comes up with the following error #NAME?



Thanks

For this
I still have one problem with this.
it works perfectly when you input the relevant info and
the days are over 15 days it will come up with a message
box. The problem is when you re-open this workbook the
message box appears before it opens! how can i stop this
from happening.

thanks.

Mark
-----Original Message-----
One way:

=IF(G415,"Please Issue Prompt Payment Letter", "")

If you want a message box instead, use

=IF(G415,PromptPayment(),"")

with this UDF in a regular code module:

Public Function PromptPayment()
MsgBox "Please issue Prompt Payment Letter"
End Function

If you're unfamiliar with UDFs, see David

McRitchie's "Getting Started
with Macros and User Defined Functions":

http://www.mvps.org/dmcritchie/excel/getstarted.htm



In article <010CA17D-1E0C-460D-A366-

,
"Monty" wrote:

if i wanted a message to appear on screen (saying

please issue prompt payment
letter)if a certain number in a cell was over 15.
how would i go about this.
i am a novice at this any help please.

.



Thanks

For this
I still have one problem with this.
it works perfectly when you input the relevant info and
the days are over 15 days it will come up with a message
box. The problem is when you re-open this workbook the
message box appears before it opens! how can i stop this
from happening.

thanks.

Mark
-----Original Message-----
One way:

=IF(G415,"Please Issue Prompt Payment Letter", "")

If you want a message box instead, use

=IF(G415,PromptPayment(),"")

with this UDF in a regular code module:

Public Function PromptPayment()
MsgBox "Please issue Prompt Payment Letter"
End Function

If you're unfamiliar with UDFs, see David

McRitchie's "Getting Started
with Macros and User Defined Functions":

http://www.mvps.org/dmcritchie/excel/getstarted.htm



In article <010CA17D-1E0C-460D-A366-

,
"Monty" wrote:

if i wanted a message to appear on screen (saying

please issue prompt payment
letter)if a certain number in a cell was over 15.
how would i go about this.
i am a novice at this any help please.

.



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

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