i don't know what the problem is.
but i noticed that the variable 'myvalue' shows up in the 'Watch' window as an array.
which seems weird since i have not declared it as an array.
Option Base 1
Dim myarray()
Dim myvalue
Range(Selection, Selection.End(xlDown)).Select
elements = Selection.Count
ReDim myarray(elements)
For i = 1 To elements
.....myarray(i) = Selection.Offset(i - 1, 0).Value
Next i
For i = 1 To elements - 1
.....myvalue = myarray(i)
.....Range("D1") = myvalue 'THE CORRECT VALUE SHOWS UP IN D1. JUST A TEST
.....For j = 1 To elements - 1
..........If myvalue > myarray(j + 1) Then 'HERE I GET THE 'Type Mismatch' ERROR
...ETC.
can't go any further till i fix the above erro.
any ideas at all?
aaaack
but i noticed that the variable 'myvalue' shows up in the 'Watch' window as an array.
which seems weird since i have not declared it as an array.
Option Base 1
Dim myarray()
Dim myvalue
Range(Selection, Selection.End(xlDown)).Select
elements = Selection.Count
ReDim myarray(elements)
For i = 1 To elements
.....myarray(i) = Selection.Offset(i - 1, 0).Value
Next i
For i = 1 To elements - 1
.....myvalue = myarray(i)
.....Range("D1") = myvalue 'THE CORRECT VALUE SHOWS UP IN D1. JUST A TEST
.....For j = 1 To elements - 1
..........If myvalue > myarray(j + 1) Then 'HERE I GET THE 'Type Mismatch' ERROR
...ETC.
can't go any further till i fix the above erro.
any ideas at all?
aaaack