K
Kou Vang
I have several listboxes that are mult-selectable. In my code below, when I
select a row, I notice that the row I select in my listbox isn't being stated
in my code. So if I select index(1), it's not stating that I selected row 2?
I have all the listbox attributes the same, column 1, bound column 1,
multiselect=simple. I don't know what else to say?
Option Explicit:
Dim VarItm As Variant
Dim OrigVal, TotAvg
Dim I As Integer
Dim Per1, Per2, Per3
OrigVal = 0
I = 0
For Each VarItm In lstAdjHist2.ItemsSelected
OrigVal = OrigVal + Val(lstAdjHist2.Column(0, VarItm))
Debug.Print lstAdjHist2.Column(0, VarItm)
I = I + 1
Next VarItm
TotAvg = Round(OrigVal / I)
Debug.Print TotAvg
lstHistRec2.AddItem CStr(TotAvg)
select a row, I notice that the row I select in my listbox isn't being stated
in my code. So if I select index(1), it's not stating that I selected row 2?
I have all the listbox attributes the same, column 1, bound column 1,
multiselect=simple. I don't know what else to say?
Option Explicit:
Dim VarItm As Variant
Dim OrigVal, TotAvg
Dim I As Integer
Dim Per1, Per2, Per3
OrigVal = 0
I = 0
For Each VarItm In lstAdjHist2.ItemsSelected
OrigVal = OrigVal + Val(lstAdjHist2.Column(0, VarItm))
Debug.Print lstAdjHist2.Column(0, VarItm)
I = I + 1
Next VarItm
TotAvg = Round(OrigVal / I)
Debug.Print TotAvg
lstHistRec2.AddItem CStr(TotAvg)