View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Message Box to Appear if Cell Values In Range Differ

Just change it to this

If Application.CountIf(Range("C2:C500"), Range("C2").Value) < _
Application.CountA(Range("C2:C500")) Then

MsgBox "not all the same"
End If


--
__________________________________
HTH

Bob

"Monk" wrote in message
...
Thanks Bob. This works well but I forgot to advise that within that range
there may be blank cells. Can you please advise how this would be
modified
to ignore blank cells within that C2:C500 range so that the error message
will only appear if data appears within that range?

Cheers

Monk

"Bob Phillips" wrote:


IF Application.COUNTIF(Range("C2:C500"), Range("C2).Value) <
Range("C2:C500").Cells.Count Then

Msgbox "not all the same"

End If

--
__________________________________
HTH

Bob

"Monk" wrote in message
...
Hi

I am currently pasting worksheet data into a new spreadsheet and all
the
dates in the cell range C2:C500 should be the same. However from time
to
time
one or two dates may differ. I would like a message box to appear as
soon
as
the data is pasted in to the new sheet if any on the dates in the range
should not be identical.

Any assistance you could provide would be appreciated.

Thanks

Monk