Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Evaluating a group of cells
I want to be able to have a message in a cell that alerts users to the value
in each of the four cells being the same: EG If A1,B1,C1,D1 are all the same value then put a message in B1. I tried to use the AND function but it came back as false. Any ideas please on how i might do this. Thanks John |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Evaluating a group of cells
Hi John
You can't have a function in B1 and a number to evaluate with other cells. Put this =IF(AND(B1=A1,B1=C1,B1=D1),"All the same","Not the same") in an empty cell and try it if its what you want. Regards Cimjets "John" wrote in message ... I want to be able to have a message in a cell that alerts users to the value in each of the four cells being the same: EG If A1,B1,C1,D1 are all the same value then put a message in B1. I tried to use the AND function but it came back as false. Any ideas please on how i might do this. Thanks John |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Evaluating a group of cells
Try this worksheet event macro:
Private Sub Worksheet_Change(ByVal Target As Range) Set r = Range("A1:D1") Set b1 = Range("B1") Set t = Target If Intersect(t, r) Is Nothing Then Exit Sub a = Range("A1").Value b = Range("B1").Value c = Range("C1").Value d = Range("D1").Value b1.ClearComments If a = b And b = c And c = d Then b1.AddComment b1.Comment.Visible = True b1.Comment.Text Text:="WARNING!!!" End If End Sub Because it is worksheet code, it is very easy to install and use: 1. right-click the tab name near the bottom of the window 2. select View Code - this brings up a VBE window 3. paste the stuff in and close the VBE window If you save the workbook, the macro will be saved with it. To remove the macro: 1. bring up the VBE windows as above 2. clear the code out 3. close the VBE window To learn more about macros in general, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm To learn more about Event Macros (worksheet code), see: http://www.mvps.org/dmcritchie/excel/event.htm -- Gary''s Student - gsnu200794 "John" wrote: I want to be able to have a message in a cell that alerts users to the value in each of the four cells being the same: EG If A1,B1,C1,D1 are all the same value then put a message in B1. I tried to use the AND function but it came back as false. Any ideas please on how i might do this. Thanks John |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Evaluating a group of cells
What AND formula did you use?
Do the cells contain text or numbers? If text, are you sure that some don't have extraneous spaces or other non-printing characters? If numbers, are you sure that there aren't small rounding errors? Also, how could you put a message in B1, if B1 is one of the input cells? -- David Biddulph "John" wrote in message ... I want to be able to have a message in a cell that alerts users to the value in each of the four cells being the same: EG If A1,B1,C1,D1 are all the same value then put a message in B1. I tried to use the AND function but it came back as false. Any ideas please on how i might do this. Thanks John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
evaluating text of cells | Excel Discussion (Misc queries) | |||
Copy Data from One Group of Cells to Another Group | Charts and Charting in Excel | |||
from a group of cells.find average of cells containing values | Excel Discussion (Misc queries) | |||
If formula evaluating 2 cells contents | Excel Worksheet Functions | |||
copy group of cells to another group of cells using "IF" in third | Excel Worksheet Functions |