Private Sub CommandButton2_Click()
Dim x As Integer
x = I2
Range("G" & Target.Row).Value = Range("G" & Target.Row) * (1 - Range("I2").Value)
End Sub
Private Sub CommandButton2_Click()
Dim x As Integer
x = I2
If Range("G" & Target.Row) > 0 Then Range("G" & Target.Row).Value = Range("G" & Target.Row) * (1 - Range("I2").Value)
End Sub
Giggzz said:Code:Private Sub CommandButton2_Click() Dim x As Integer Range("G9").Value = Range("I2") * Range("G9") End Sub
Here what I have so far but not getting the result I need. its giving me the discount but I need to subtract it from the orginal figure.....
Range("G9").Value = Range("G9").Value * (1 - Range("I2").Value)
Private Sub CommandButton2_Click()
ActiveSheet.Unprotect ("national")
Dim x As Integer
x = I2
If Range("G" & ActiveCell.Row) > 0 Then
Range("G" & ActiveCell.Row) = Range("G" & ActiveCell.Row) * (1 - Range("I2").Value)
ActiveSheet.Protect ("national")
End If
End Sub
ADVERTISEMENT
Private Sub CommandButton1_Click()
Dim cell As Range
For Each cell In Range("G9:G18")
cell.Value = cell.Value * (1 - Range("I2").Value)
Next cell
End Sub