ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   chg by val (https://www.excelbanter.com/excel-programming/424646-chg-val.html)

Curt

chg by val
 
If target.column = 12 And target.Value 0 And IsNumeric(target.Value) Then _
Call Pledge(target)
When entry is made in column 12 object is to have entry in column 16 = 0
This is called from entry in column 12 however nothing happens.

Public Sub Pledge(ByVal target As range)
Dim column As Variable
Sheets("Data").Select
If target.column = 16 Then _
target.Value = 0
End Sub

Bernie Deitrick

chg by val
 
Curt,

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Target.Column = 12 And _
Target.Value 0 And _
IsNumeric(Target.Value) Then Pledge Target
End Sub
Public Sub Pledge(ByRef Target As Range)
Sheets("Data").Cells(Target.Cells(1).Row, 16).Value = 0
End Sub

HTH,
Bernie
MS Excel MVP


"Curt" wrote in message
...
If target.column = 12 And target.Value 0 And IsNumeric(target.Value)
Then _
Call Pledge(target)
When entry is made in column 12 object is to have entry in column 16 = 0
This is called from entry in column 12 however nothing happens.

Public Sub Pledge(ByVal target As range)
Dim column As Variable
Sheets("Data").Select
If target.column = 16 Then _
target.Value = 0
End Sub




All times are GMT +1. The time now is 05:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com