ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   using an if then statement call a caption box to a cell (https://www.excelbanter.com/excel-programming/331940-using-if-then-statement-call-caption-box-cell.html)

ratt[_3_]

using an if then statement call a caption box to a cell
 

In my excel project, I have a cell that performs a sum function. a
associated goal is tied to that cell and consequently the results...
want to develop an if then statement that upon reaching the goal,
caption, lable, or text box (msgbox) will appear and give a message t
the user...how is this possible?

tks ahead of time

ratt ou

--
rat
-----------------------------------------------------------------------
ratt's Profile: http://www.excelforum.com/member.php...fo&userid=2431
View this thread: http://www.excelforum.com/showthread.php?threadid=37957


ratt[_4_]

using an if then statement call a caption box to a cell
 

do you use a control to put it in or do you put it directly tin to th
code...do you dim ianything in the code or do you simply put it in th
cell like you would a formula?

tk

--
rat
-----------------------------------------------------------------------
ratt's Profile: http://www.excelforum.com/member.php...fo&userid=2431
View this thread: http://www.excelforum.com/showthread.php?threadid=37957


mangesh_yadav[_348_]

using an if then statement call a caption box to a cell
 

Hi,

Since you posted this in the programming section, and since you had not
given any more details....

Assuming that you enter your input in cells A1 and A2, And cell B2 is
the one which you want to check, you could have enter the following
code in the module of the concerned sheet. Right click on the tab which
holds the sheet name, click view code, and enter the following code:


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Or Target.Address = "$A$2" Then
If Range("B2") = 100 Then
MsgBox ("Goal value reached")
End If
End If
End Sub


Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=379571



All times are GMT +1. The time now is 01:50 AM.

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