Sequencing VBA routines problem

Status
Not open for further replies.

hellcat83

New Member
Joined
Aug 16, 2011
Messages
44
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 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.
I currently have both routines in the same event as they are both WorkSheet_Change events, with the routines in the order described here.

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
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Status
Not open for further replies.

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top