From what you describe it seems to be working as I intended and what I
thought you wanted -
a) Define a named range "myList" A1:A22 for the 'entire' DV list.
b) Define a 'dynamic' named range "myList8" to return cells from the value
of the spinner (linked to E1) to 8 rows below.
c) Set the 'Max' value of the spinner to 8 less than the rows-count of
"myList"
So when the spinner changes the drop down list should show the dynamic range
myList8, namely a segment of the full list (myList) between the value of the
spinner and 8 rows down. Indeed the spinner should stop at 8 less than the
count of the full list (without re-creating I would have thought the spinner
stops at 15 rather than 14, ie 22-8 in the example).
It's not designed to change the value of the DV cell, do that by selecting
from the 'reduced' dropdown having set it approximately in the right region
with the spinner.
Do I follow correctly you want the spinner to change the DV cell. Wouldn't
that mean changing the spinner between 1 & 10's of k's, a lot of clicks!
surely not.
Try re-defining the name 'myList' to the range of your actual list (a single
column).
As you've got such a large list increase each instance of 8 in the example
to say 25.
I also need to preserve the ability to access the entire range
of values in the DV drop down at all times for the long scrolls to older
records (there is a list of 10s of thousands of rows). Do you have a way to
do this?
Sub ToggleDVlist()
Dim dvCell As Range
Dim sFmla As String
Static bFlag As Boolean
sFmla = IIf(bFlag, "=myList", "=myList8")
bFlag = Not bFlag
Set dvCell = Range("E5") ' the DV cell on activesheet
With dvCell.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:=sFmla
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
MsgBox "DV list in " & dvCell.Address(0, 0) & " " & sFmla
End Sub
This is only slightly adapted from a recorded macro. Record your own to get
any other DV settings and adapt as above. Run the macro from a button on the
sheet.
Regards,
Peter T
PS don't forget you can change the value in the spinner's linked cell (E1 in
the example) instead of using the spinner, and avoid many spinner clicks.