View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JulieD JulieD is offline
external usenet poster
 
Posts: 618
Default Range.Validation Questions

Hi Ben

one option, you could cycle through the range you've selected checking the
length in each cell and writing the "non-compliant" cells to a message box
e.g.

Dim strmsg

strmsg = "Non Compliant cells"
For Each cell In myrange 'use the range you've already selected
If Len(cell.Value) < 10 Then 'or whatever length you're after
strmsg = strmsg & "; " & cell.Address
End If
Next
MsgBox strmsg

Hope this helps
Cheers
JulieD

"Ben Crinion" wrote in message
...
Hi

I have an applicaton that takes a selection of cells which should be a
list of numbers.

I use the SpecialCells function to ensure that i have a range which
consists of only numbers and no text strings.

I also want to ensure that all the strings are of a minimum length. I know
there is a range validation method and a textLength option that goes with
it but im not sure if it will do what i want it to. I cant find much info
on how to use it other than the 1 example on MSDN.

Anyone got any clues?

Thanks

BC