Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Message Box to Appear if Cell Values In Range Differ

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Message Box to Appear if Cell Values In Range Differ


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Message Box to Appear if Cell Values In Range Differ

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Message Box to Appear if Cell Values In Range Differ

Thanks Bob. Works perfectly. Much appreciated

"Bob Phillips" wrote:

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






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
Comparing the values in two cells, then counting how many differ cgm02 Excel Worksheet Functions 2 August 29th 09 02:09 AM
Array formula to display 1 if concatentaed values differ.. bony_tony Excel Worksheet Functions 3 December 12th 07 04:24 PM
Excel: want header cell sizes to differ from the other sheet cell. mayrl Excel Discussion (Misc queries) 0 January 18th 06 06:41 PM
Send the Document, may differ some place due to cell contents... SupperDuck Excel Discussion (Misc queries) 0 October 21st 05 09:35 PM
can I delete entire row if adjacent cell formats differ? ksukid Excel Worksheet Functions 0 May 19th 05 09:28 PM


All times are GMT +1. The time now is 05:36 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"