4. März 2009 10:56
Range("A7").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Ja;Nein"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub
4. März 2009 12:16
5. März 2009 09:36
PROCEDURE CreateValidationRuleFromList@1106800001(Range@1000 : Code[20];p_ValidList@1106800000 : Variant);
VAR
XLValidation@1001 : Automation "{00020813-0000-0000-C000-000000000046} 1.5:{0002442F-0000-0000-C000-000000000046}:'Microsoft Excel 11.0 Object Library'.Validation";
XLRange@1002 : Automation "{00020813-0000-0000-C000-000000000046} 1.5:{00020846-0000-0000-C000-000000000046}:'Microsoft Excel 11.0 Object Library'.Range";
BEGIN
XlApp.Goto(Range);
XLRange := XlApp.Selection;
XLValidation := XLRange.Validation;
XLValidation.Add(3,1,1,p_ValidList);
XlApp.Goto(XlApp.PreviousSelections(1));
END;
IF txtValidCountries <> '' THEN BEGIN
// 12
ExcelBuf.SetCurrent(2,12);
ExcelBuf.StartRange;
ExcelBuf.SetCurrent(65000,12);
ExcelBuf.EndRange;
ExcelBuf.CreateRange(Text201);
ExcelBuf.CreateValidationRuleFromList(Text201,txtValidCountries);
END;