Excel pop up message

BlackPanther

New Member
Joined
May 11, 2015
Messages
21
Hi all,

I need to create a pop up message for a whole column/ or A1 : A 60. if the value in B1 is greater than or equal to 100

I am new to VBA in excel
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Do you want a pop up message if any of the values from A1:A60 is > or = to the value in B1?
 
Upvote 0
Yes @
Caribeiro77
user-online.png
 
Upvote 0
Try:
Press ALT+F11
Insert module
And paste the bellow code ( you may have to change sheet name)

Code:
Sub findvaluegreaterigualto()


Dim findvalue As Range


Set findvalue = Sheet1.Range("A1:A60")


findvalue.Font.Color = vbBlack
findvalue.Interior.Color = xlNone


For Each cell In findvalue


    If cell.Value >= Range("B1") Then


      MsgBox ("You have values that exced value in cell B1")


        cell.Interior.Color = vbRed
        cell.Font.Color = vbWhite


    End If


Next cell


End Sub


After this you can craete a excel shape directly on the sheet and assign the macro..
 
Upvote 0
Caribeiro77
user-offline.png



I have a query , the code that you provided worked very well as per my need.

Just imagine the same scenario , but the column A is automatically filled by the computer . and we see the result after the execution . is there any code for such a scenario?


when i open the excel sheet the colums greater than or equal to 100 whould be highlighted. ( no pop up )
 
Upvote 0
but the column A is automatically filled by the computer

How does this happen's?
And is it all column A or just the same range of your post #1 (A1:A60)?

when i open the excel sheet the colums greater than or equal to 100 whould be highlighted

Which columns?
 
Upvote 0
column A , The code you provided works good .

But what i mean is , Column A will be entered automatically by the system during execution of a program.

Can we write a same code , but Cells greater than or equal to 100 will be highlithed when we open the excel sheet in advance
 
Upvote 0
Do you want that to happen only when you open the sheet or do you want that to happenwhen it hoppen's and also every time the b«numbers change( after the excecution of the program)?
 
Upvote 0

Forum statistics

Threads
1,215,379
Messages
6,124,605
Members
449,174
Latest member
ExcelfromGermany

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