Romano_odK
Active Member
- Joined
- Jun 4, 2020
- Messages
- 380
- Office Version
- 365
- Platform
- Windows
Good afternoon,
As from all the help I get I collected some VBA code. Now what I would like to achieve is that the amount of row that are negative will be displayed in the command button named "Negatief". Can this be done? Thank you for your time.
The below will not work. What I need is Command button 'Negatief" to be displaying the amount of negative values in the sheet "Boekingen" with table name 'Locatie" with header ""Voorraad". Then the value needs to change when something in sheet changes.
As from all the help I get I collected some VBA code. Now what I would like to achieve is that the amount of row that are negative will be displayed in the command button named "Negatief". Can this be done? Thank you for your time.
The below will not work. What I need is Command button 'Negatief" to be displaying the amount of negative values in the sheet "Boekingen" with table name 'Locatie" with header ""Voorraad". Then the value needs to change when something in sheet changes.
VBA Code:
Private Sub worksheet_change(ByVal target As Range)
Negatief.Caption = "Stock < 0" & Chr(10) & Sheet1.Range("B3").Value
Range("J1").Value = Application.CountIf(Range("Locatie[Voorraad]"), "<0")
End Sub