New to VBA coding in Excel, I can't seem to figure out how to code this.
I want to go thru each row of the "Office View" worksheet. In this table, column C is for License Numbers and column W is for Bonuses (currency).
The code I'm using below is resulting in only the Column W Value for the ActiveRow, not from looping.
Also I run this code from a button. I click on a cell to choose the ActiveRow to transfer certain cell data to a from. But want to add up a filtered count of Column W and put it on the form. The filter is equal to the Licnumber of the ActiveRow. (Found in Column C).
Code:
row_review = 2
Dim TheSheet As Worksheet
Set TheSheet = Sheets("Office View")
Dim LastRow, Licnum
Dim Bealtotalsplit As Currency
LastRow = Sheets("Office View").Range("A" & Rows.Count).End(xlUp).Row
Licnum = Sheets("Office View").Range("C" & (ActiveCell.Row)).Value
Bealtotalsplit = 0
Do
DoEvents
row_review = row_review + 1
item_in_review = TheSheet.Range("C" & row_review)
If item_in_review = Licnum Then
Bealtotalsplit = Bealtotalsplit + Sheets("Office View").Range("W" & (ActiveCell.Row)).Value
End If
Loop Until LastRow
OFFICEVIEWTRANSfrm!BEALSPLITbox.Value = Format(Bealtotalsplit, "CURRENCY")
Appreciate the help.
SnayJ