Dim val As String
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
val = Target.Value
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
Dim lRowG As Long, lRowFA As Long, fund As Range, fund2 As Range
lRowG = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
If Intersect(Target, Range("I7:W" & lRowG)) Is Nothing Then Exit Sub
lRowFA = Sheets("Funds Available").Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
If Target <> "" Then
Set fund = Sheets("Funds Available").Range("A2:A" & lRowFA, "I2:I" & lRowFA).Find(Target.Value, LookIn:=xlValues, lookat:=xlWhole)
If val = "" Then
fund.Offset(, 6).Value = fund.Offset(, 6).Value - 1
ElseIf Target.Value <> val Then
Set fnd2 = Sheets("Funds Available").Range("A2:A" & lRowFA, "I2:I" & lRowFA).Find(val, LookIn:=xlValues, lookat:=xlWhole)
fnd2.Offset(, 6).Value = fnd2.Offset(, 6).Value + 1
fund.Offset(, 6).Value = fund.Offset(, 6).Value - 1
End If
Else
Set fund = Sheets("Funds Available").Range("A2:A" & lRowFA, "I2:I" & lRowFA).Find(val, LookIn:=xlValues, lookat:=xlWhole)
fund.Offset(, 6).Value = fund.Offset(, 6).Value + 1
End If
Range("A2").Select
Application.CutCopyMode = False
Application.ScreenUpdating = False
End Sub