View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Ed[_18_] Ed[_18_] is offline
external usenet poster
 
Posts: 118
Default Excel VBA programmatic validation problem

Have you tried writing your validations in a range of cells, and then
programmatically setting your validation to that range? That's what I do.

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=
_
xlBetween, Formula1:="=$AD$" & StCol & ":$AD$" & EndCol
' StCol and EndCol are variables representing the row numbers that
' start and end my column of validations
.IgnoreBlank = False
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

HTH
Ed

"ZoomZoom " wrote in message
...
I've attached a zipped up working example that uses Chip's code in
the
Worksheet activate event.

You couldn't send it by email could you?

The board code has decided to display the zip rather than linking it.
Thanks very much,

Justin


---
Message posted from http://www.ExcelForum.com/