PDA

View Full Version : [SOLVED] Data Validation formula issues



nikki333
09-20-2018, 02:03 PM
Hi Folks

I'm trying to set up a data validation formula via VBA. That should not be too difficult, however, it is, acutally to me.

Basically I just want to allow x or empty ("") values to be allowed in a certain range.

With that range, I've been trying like so:

with myrange


With .Validation
.Delete
.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=WENN(ODER(D4= ""x"";D4 ="""");WAHR;FALSCH)"
end with

end with

This works for the cell D4 then only, but how do i get this to work for the whole range...let's say D4:E100

Any help very welcome, cheers

nikki333
09-22-2018, 06:05 AM
Solved it myself

Formula1:="""x"";"""""