MsgBox Trouble

G

Guest

Guest
I would like to have a MsgBox pop up and ask a yes,no question when a specific cell value is greater than 1, if the answer is yes, I would like to put a value of one (1) in another column in a cell. I would like it to start at row 4 thru row 368 or so, anyway, I can't get the MsgBox to pop up unless i run the code manually, I also cannot get it to put a one in the other column. Sounds and is confusing to me, can anyone help? Thanks in advance
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
You can start by inserting this function in a module.

Public Function StartMsg()
StartMsg = MsgBox("test", vbOKCancel)
If StartMsg = 2 Then StartMsg = ""
End Function

If the cell to check for 1 is A1 and the cell where to put the

result is B1 then put this formula in B1:
=IF(A1=1;StartMsg();"")

regards Tommy
 
Upvote 0
On 2002-03-09 11:27, Tommy Bak wrote:
You can start by inserting this function in a module.

Public Function StartMsg()
StartMsg = MsgBox("test", vbOKCancel)
If StartMsg = 2 Then StartMsg = ""
End Function

If the cell to check for 1 is A1 and the cell where to put the

result is B1 then put this formula in B1:
=IF(A1=1;StartMsg();"")

regards Tommy

Hi Tommy

Excellent suggestion


Ivan
 
Upvote 0

Forum statistics

Threads
1,214,400
Messages
6,119,288
Members
448,885
Latest member
LokiSonic

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top