Range("C4").Select
Application.CutCopyMode = False
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=Materials"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
I am trying to contruct a data validation to a one cell with macro. So that when you choose the material the graph will automatically change. Materials in the code is the data validation range, I named the range hoping that resolves the error.
So the main problem is that while the macro is running it gives "Run time error 1004". If I debug and put my yellow cursor to a few step back and go with f8, it works perfectly. I take this code from record macro. Code seems right but I don't know why macro gives error about it.