Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,069
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 95
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
evaluating text of cells [email protected] Excel Discussion (Misc queries) 1 January 22nd 08 07:03 PM
Copy Data from One Group of Cells to Another Group Alan Auerbach Charts and Charting in Excel 2 May 27th 07 04:12 PM
from a group of cells.find average of cells containing values farm Excel Discussion (Misc queries) 1 December 21st 06 08:50 PM
If formula evaluating 2 cells contents N E Body Excel Worksheet Functions 3 August 17th 05 06:54 PM
copy group of cells to another group of cells using "IF" in third Chuckak Excel Worksheet Functions 2 November 10th 04 06:04 PM


All times are GMT +1. The time now is 08:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"