Hi All,
I'm Neil and new to VBA, I have attached a worksheet similar to my work. In this worksheet, I have a 3 column ListBox with RecordID, Description & NetWeight values on it.
Below the ListBox, I have 2 textbox to be populated with Counter and the Cummulative Net Weight, respectively. In my code the Counter seems to be correct, but my cumulative weight was adding up wrong. Can anyone help me to give the correct code. Here is the part of code below...
'Count and Sum of Net Weigths
wSum = "0"
wList = ListBox1.List(ListBox1.ListCount - 1, 2)
ListBox1.ListIndex = xList
For xList = 0 To (ListBox1.ListCount - 1)
wSum = Val(wSum) + Val(wList)
TextBox4.Value = wSum
TextBox3.Value = xList + 1 'Counter of entries
Next xList
I'm Neil and new to VBA, I have attached a worksheet similar to my work. In this worksheet, I have a 3 column ListBox with RecordID, Description & NetWeight values on it.
Below the ListBox, I have 2 textbox to be populated with Counter and the Cummulative Net Weight, respectively. In my code the Counter seems to be correct, but my cumulative weight was adding up wrong. Can anyone help me to give the correct code. Here is the part of code below...
'Count and Sum of Net Weigths
wSum = "0"
wList = ListBox1.List(ListBox1.ListCount - 1, 2)
ListBox1.ListIndex = xList
For xList = 0 To (ListBox1.ListCount - 1)
wSum = Val(wSum) + Val(wList)
TextBox4.Value = wSum
TextBox3.Value = xList + 1 'Counter of entries
Next xList