ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,226
- Office Version
- 2007
- Platform
- Windows
Afternoon,
I am having some issues with a RTE as shown in screen shot supplied.
This is how my worksheet code should operate.
INCOME 1
Values are in cells C30 D30 E30 F30
I then run this code below which should copy the values mentioned above, This is done when the worksheet is full.
The code will then place the values as advised into this worksheet / cells as shown below.
INCOME 2
C4 D4 E4 F4
When i use DEBUG i see this shown in yellow.
I now see the RTE as mentioned BUT doesnt happen each time ?
Can you see why.
Thanks
I am having some issues with a RTE as shown in screen shot supplied.
This is how my worksheet code should operate.
INCOME 1
Values are in cells C30 D30 E30 F30
I then run this code below which should copy the values mentioned above, This is done when the worksheet is full.
The code will then place the values as advised into this worksheet / cells as shown below.
INCOME 2
C4 D4 E4 F4
Rich (BB code):
Private Sub CommandButton1_Click()
Sheets("INCOME (2)").Range("C4:D4").Value = Sheets("INCOME (1)").Range("C30:E30").Value
Sheets("INCOME (2)").Range("E4").Value = Sheets("INCOME (1)").Range("E30").Value
Sheets("INCOME (2)").Range("F4").Value = Sheets("INCOME (1)").Range("F30").Value
Sheets("INCOME (2)").Activate
ActiveSheet.Range("A5").Select
If Sheets("INCOME (2)").Range("G32").Value <> Sheets("INCOME (1)").Range("G32").Value Then MsgBox "Balance of sheets incorrect", vbCritical, "G32 CELLS DO NOT MATCH"
End Sub
When i use DEBUG i see this shown in yellow.
Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("E4:E30")) Is Nothing Then
Application.EnableEvents = False
Range("E4:E30").Formula = "=IF(C5="","",IF(ISERROR(C5+D5),"",C5+D5))"
Application.EnableEvents = True
End If
' Exit if more than one cell updated at a time
If Target.Count > 1 Then Exit Sub
' Check to see if value updated is in column B or D
If Target.Column = 2 Or Target.Column = 3 Then
Application.EnableEvents = False
If UCase(Cells(Target.Row, "B")) = "REFUND" Then
Cells(Target.Row, "C") = Abs(Cells(Target.Row, "C")) * -1
Else
If Cells(Target.Row, "B") = "" Then Cells(Target.Row, "C").ClearContents
End If
Application.EnableEvents = True
End If
If Not (Application.Intersect(Target, Range("A3:G28")) _
Is Nothing) Then
With Target
If Not .HasFormula Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End With
End If
End Sub
Can you see why.
Thanks