P
Phil Sobolik
This was covered in a thread back in 1999, but the response didn't
work for me. I'm trying to add a drop-down list to a cell with valid
entries for that cell.
With Application.ActiveWorkbook.Worksheets("Items")
.Unprotect
With .Cells(1, 1).Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Formula1:="1,2,3"
.InCellDropdown = True
End With ' Validation
End With ' Worksheet
Doesn't work. I get an 'Application-defined or object-defined error -
1004' at the Add call. I realize that there are a number of ways that
the list can be specified - a Range (named or with an address) will be
the eventual way, but I've used a typed in list as a trivial example.
I can do it in the worksheet itself, but not with VBA. The worksheet
isn't protected, the cell isn't locked. I got the Delete call from
the previous thread. Modify without the Delete doesn't work either.
This is a crucial part of the project I'm working on. It's a do or
the project dies situation.
Excel 2000 9.0.6926 SP3 on Windows 2000
Any help would be greatly appreciated!
work for me. I'm trying to add a drop-down list to a cell with valid
entries for that cell.
With Application.ActiveWorkbook.Worksheets("Items")
.Unprotect
With .Cells(1, 1).Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Formula1:="1,2,3"
.InCellDropdown = True
End With ' Validation
End With ' Worksheet
Doesn't work. I get an 'Application-defined or object-defined error -
1004' at the Add call. I realize that there are a number of ways that
the list can be specified - a Range (named or with an address) will be
the eventual way, but I've used a typed in list as a trivial example.
I can do it in the worksheet itself, but not with VBA. The worksheet
isn't protected, the cell isn't locked. I got the Delete call from
the previous thread. Modify without the Delete doesn't work either.
This is a crucial part of the project I'm working on. It's a do or
the project dies situation.
Excel 2000 9.0.6926 SP3 on Windows 2000
Any help would be greatly appreciated!