Hi
I've recently been writing a few routines with help from this forum (I'm completely new to VBA).
The project I'm currently working on needs two separate routines on one sheet;
The problem I have is that even though the range on the second routine includes cells other than those included in routine 1, it isn't activated unless an entry is made in the routine 1 cells.
I've looked at the code, but other than working the above out, I have no idea how I could go about sorting it.
The routines look like;
Private Sub Worksheet_Change(ByVal Target As Range)
''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''
' This section appends any new exam mark entry with an "e" for later formatting.
Dim DivRg As Range
'''''''''''
Set DivRg = Range("BJ11:BL320")
Set DivRg = Application.Intersect(Target, DivRg)
If DivRg Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Target = Target & "e"
Application.EnableEvents = True
Set DivRg = Nothing
'''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''
Dim Row As Integer
''''''''''''''''''''''''''''''''''''''''
' This section monitors assessment columns, placing the most recent entry for each pupil in
' additional columns in management sheet.
''''''''''''''''''''''''''''''''''''''''
' Biology Assessments Y7
MsgBox Target
For Row = 11 To 303
FirstCol = "X" & Row
SecCol = "AA" & Row
ThirdCol = "AJ" & Row
FourthCol = "AL" & Row
FifthCol = "BJ" & Row
OutCol = "FA" & Row
If Not Intersect(Target, Range(FirstCol & ":" & SecCol & "," & ThirdCol & ":" & FourthCol & "," & FifthCol)) Is Nothing Then Sheets("KS3 Data Management Sheet").Range(OutCol).Value = Target.Value
Next Row
End Sub
If anyone has any ideas of how to sort it I would be very grateful.
Cheers
Jim
I've recently been writing a few routines with help from this forum (I'm completely new to VBA).
The project I'm currently working on needs two separate routines on one sheet;
- The first appends an "e" to any entry made into three columns.
- The second monitors these three columns and a selection of others, passing the most recent entry to a series of other cells in another sheet.
The problem I have is that even though the range on the second routine includes cells other than those included in routine 1, it isn't activated unless an entry is made in the routine 1 cells.
I've looked at the code, but other than working the above out, I have no idea how I could go about sorting it.
The routines look like;
Private Sub Worksheet_Change(ByVal Target As Range)
''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''
' This section appends any new exam mark entry with an "e" for later formatting.
Dim DivRg As Range
'''''''''''
Set DivRg = Range("BJ11:BL320")
Set DivRg = Application.Intersect(Target, DivRg)
If DivRg Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Target = Target & "e"
Application.EnableEvents = True
Set DivRg = Nothing
'''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''
Dim Row As Integer
''''''''''''''''''''''''''''''''''''''''
' This section monitors assessment columns, placing the most recent entry for each pupil in
' additional columns in management sheet.
''''''''''''''''''''''''''''''''''''''''
' Biology Assessments Y7
MsgBox Target
For Row = 11 To 303
FirstCol = "X" & Row
SecCol = "AA" & Row
ThirdCol = "AJ" & Row
FourthCol = "AL" & Row
FifthCol = "BJ" & Row
OutCol = "FA" & Row
If Not Intersect(Target, Range(FirstCol & ":" & SecCol & "," & ThirdCol & ":" & FourthCol & "," & FifthCol)) Is Nothing Then Sheets("KS3 Data Management Sheet").Range(OutCol).Value = Target.Value
Next Row
End Sub
If anyone has any ideas of how to sort it I would be very grateful.
Cheers
Jim