kann man diesen Befehlt mit einer Variablen durchführen?
Formula1:="=blatt!Z18S1:Z38S1"
Also dass quasi der hintere Teil zu einer Variablen wird. Z.B., soFormula1:=Variable
?Vielen Dank.
Formula1:="=blatt!Z18S1:Z38S1"
Also dass quasi der hintere Teil zu einer Variablen wird. Z.B., soFormula1:=Variable
?
'Deklaration
Dim var As String
var= "=Personnel!Z18S1:Z38S1"
'Formular Anweisung
Cells(c, 5).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=var
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Kommt immer noch: Anwendungs- und objekt Fehler und markiert mir :
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=var
var = "=MeineListe"
Sheets("Personnel").Range("A18:A38").Name = Mid(var, 2)
'Formular Anweisung
Cells(c, 5).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:=var
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Gruß
Cells(c, 5).Select
With Worksheets("Personnel")
.Range(.Cells(2, 1), .Cells(38, 1)).Name = "Personnel"
End With
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=Personnel"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Mid-Funktion
Gibt einen Wert vom Typ Variant (String) zurück, der eine bestimmte Anzahl von Zeichen aus einer Zeichenfolge enthält.
VG, Boris