I have an excel workbook that has been working but this morning have en-counted an error.
The error message I get is,
Run-time error 1004
Unable to set the ListFillRangeProperty of the DropDown class
Below is my code - the error happens at the first ws.DropDowns("DropDownStart").
DropDownStart and DropDownEnd are the correct names for the drop downs on my sheet so not sure what is causing this error. When I debug print the name I get
mysheetName!$A$2:$A$338
which is correct and all the cells contain dates in them. So bit stuck!
Dim ws As Worksheet
Dim wsTime As Worksheet
Set wsTime = ThisWorkbook.Sheets(WSTSJPM)
Set ws = ThisWorkbook.Sheets(WSCHARTS)
' get last date
Dim lRow As Long
lRow = wsTime.Range("A65536").End(xlUp).Row
ws.Select
ws.DropDowns("DropDownStart").ListFillRange = wsTime.Name & "!" & wsTime.Range("A2:A" & lRow).Address
ws.DropDowns("DropDownEnd").ListFillRange = wsTime.Name & "!" & wsTime.Range("A2:A" & lRow).Address
Aucun commentaire:
Enregistrer un commentaire