L
L. Howard
I want to house two different change events in this macro.
The second one at the bottom seems to be okay.
It's the AW6:AW100 range I can't seem to figure out.
The "For Each c In AWrng" code works in a conventional macro but I need it to
run on a change within the range specified.
The values in column AW are an external download of dollar amounts, so paste special is not needed, and run from a conventional macro they transfer okay.
Looking for c not blank and c is greater than 0. The greater than 0 is thekey here inasmuch as if the value is (1.00), by accounting formatting, then do not transfer the negative value, but it can change on its own to greater than 0 and that's when I need it to fire.
What I have does nothing so I am wondering if I have the wrong wording in the
"If Not Intersect(Target, Range("AW6:AW100")) Is Nothing _
Or Target.Cells.count > 1 Then Exit Sub"
statement. I've tried it without the "Not" also, and no go. Also without the "cells.count > 1"
Are both sets of the .Enable events FALSE/TRUE necessary?
Thanks.
Howard
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
With Target
If Not Intersect(Target, Range("AW6:AW100")) Is Nothing _
Or Target.Cells.count > 1 Then Exit Sub
For Each c In AWrng
If c.Offset(, -3) = "" Then
If c > 0 Then
c.Offset(, -3) = c
End If
End If
Next
End With
Application.EnableEvents = True
Application.EnableEvents = False
With Target
If Not Intersect(Target, Range("BI48:BJ65")) Is Nothing Then
Cells(.Row, 46) = Cells(.Row, 49)
End If
End With
Application.EnableEvents = True
End Sub
The second one at the bottom seems to be okay.
It's the AW6:AW100 range I can't seem to figure out.
The "For Each c In AWrng" code works in a conventional macro but I need it to
run on a change within the range specified.
The values in column AW are an external download of dollar amounts, so paste special is not needed, and run from a conventional macro they transfer okay.
Looking for c not blank and c is greater than 0. The greater than 0 is thekey here inasmuch as if the value is (1.00), by accounting formatting, then do not transfer the negative value, but it can change on its own to greater than 0 and that's when I need it to fire.
What I have does nothing so I am wondering if I have the wrong wording in the
"If Not Intersect(Target, Range("AW6:AW100")) Is Nothing _
Or Target.Cells.count > 1 Then Exit Sub"
statement. I've tried it without the "Not" also, and no go. Also without the "cells.count > 1"
Are both sets of the .Enable events FALSE/TRUE necessary?
Thanks.
Howard
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
With Target
If Not Intersect(Target, Range("AW6:AW100")) Is Nothing _
Or Target.Cells.count > 1 Then Exit Sub
For Each c In AWrng
If c.Offset(, -3) = "" Then
If c > 0 Then
c.Offset(, -3) = c
End If
End If
Next
End With
Application.EnableEvents = True
Application.EnableEvents = False
With Target
If Not Intersect(Target, Range("BI48:BJ65")) Is Nothing Then
Cells(.Row, 46) = Cells(.Row, 49)
End If
End With
Application.EnableEvents = True
End Sub