ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   help with stupid (simple) error (https://www.excelbanter.com/excel-programming/338387-help-stupid-simple-error.html)

Mark Kubicki

help with stupid (simple) error
 
why isn't this assigning the value (i'm tired, it's late, and i'm just
missing the obvious... blah, blah, blah)

If Not Intersect(Target, Me.Range("c14:c23")) Is Nothing Then 'Exit Sub
With Target
If Target.Offset(0, -1).Value = "" Then
Range(Target.Offset(0, -1)).Value = "1"
End If
End With
End If




Jim Cone

help with stupid (simple) error
 
mark,

I cleaned it up a little...
'-------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo NoChange
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("C14:C23")) Is Nothing Then
If Target.Offset(0, -1).Value = "" Then Target.Offset(0, -1).Value = "1"
End If
NoChange:
Application.EnableEvents = True
End Sub
'------------------

Jim Cone
San Francisco, USA


"mark kubicki" wrote in message
...
why isn't this assigning the value (i'm tired, it's late, and i'm just
missing the obvious... blah, blah, blah)

If Not Intersect(Target, Me.Range("c14:c23")) Is Nothing Then 'Exit Sub
With Target
If Target.Offset(0, -1).Value = "" Then
Range(Target.Offset(0, -1)).Value = "1"
End If
End With
End If





All times are GMT +1. The time now is 12:53 PM.

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