HELLO,

I struggle up for last two days for this issue. Here i explained it and give my code. Please anyone look into this and help me to resolve.

Requirements:

I have Array() values having only Year information

Array(0) = (Deepak) 1987
Array(1) = (G.Lakshmi) 1985
Array(2) = (U.Dev) 1988
Array(3) = (G.Kannan) 1985
Array(4) = (D.Dhana) 1988

I sorted this array Chronologically

Code:
WordBasic.SortArray Array()
So that i Got the values:

Sortarray(0) = (G.Lakshmi) 1985
Sortarray(1) = (G.Kannan) 1985
Sortarray(2) = (G.Deepak) 1987
Sortarray(3) = (U.Dev) 1988
Sortarray(4) = (D.Dhana) 1988

Again i have to sort this array values alphabetically So that i need to print this values

Sortarray1(0) = (G.Kannan) 1985
Sortarray1(1) = (G.Lakshmi) 1985
Sortarray1(2) = (G.Deepak) 1987
Sortarray1(3) = (D.Dhana) 1988
Sortarray1(4) = (G.Dev) 1988


Dim II As Integer
Dim JJ As Integer
Dim KK As Integer
Dim N As Integer
Dim Counter As Integer

For II = 0 To UBound(adarry())
Counter = 1
For JJ = II + 1 To UBound(adarry())
If adarry(II) = adarry(JJ) Then
Counter = Counter + 1
MsgBox (Counter)
End If
Next JJ
'Lop1:
If Counter = 1 Then
'For KK = 0 To UBound(adarry())


Code:
Dim i1 as integer
Dim j1 as integer
Dim II As Integer
Dim JJ As Integer
Dim KK As Integer
Dim N As Integer
Dim Counter As Integer

i1 having the value of LBArray and J1 the value of UBArray



For II = 0 To UBound(SortArray())
Counter = 1
For JJ = II + 1 To UBound(SortArray())
If SortArray(II) = SortArray(JJ) Then
Counter = Counter + 1
MsgBox (Counter)
End If
Next JJ
'Lop1:
If Counter = 1 Then
For N = i1 To J1
If SortArray(II) = ReferenceYear(N) Then
Selection.TypeText Text:="(" & Authorname(N) & Array(N) & ")"
End If
Next N
End If
II = II + Counter
Next II
It print only the (Name and Year) improperly. Did Anyone can look into this?