View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Elkar
 
Posts: n/a
Default how do i create a macro that would check the contents of cells

You wouldn't need to use VB for this. You could just use Data Validation.
Select your 6 cells, then select "Data" from the menu bar, then select
"Validation..."

In the ALLOW box, select "Custom"
Then in the FORMULA box, enter: =NOT(AND($A$1:$F$1="X"))

Of course, change the cell references to match your needs. You can then
change the error messages to whatever you want.

HTH,
Elkar


"Jade" wrote:

Hi, I am stcuk on Excel VB. I am trying to create a macro that when run would
check to see if there is an 'X' in 6 specific cells on a row(the cells are
next to each other), there is an X in all of them it would then display a msg
saying 'not possible', else it would not doing anything. I hope i did pass
the problem across in a sensible manner. Thanks for helping.