Creating an array variable with a variable number of elements
问题 I want to define an array variable to have a variable number of elements depending on the m number of results returned from a search. I get an error "Constant Expression Required" on: Dim cmodels(0 To m) As String Here is my complete code Dim foundRange As Range Dim rangeToSearch As Range Set rangeToSearch = Selection Set foundRange = rangeToSearch.Find(What:="Lights", After:=ActiveCell, LookIn:=xlValues, LookAt:= _ xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _ ,