LBinGA
1.
I installed this code on the Prospects Archive:
Why add the code to this sheet - isn't it the destination? Should you not have added the code to the "Prospects" sheet?
2.
Set rngDest = Worksheets("Archive").Range("rngDest")
As per comments above, shouldn't the sheet name be "Prospects Archive" rather than just "Archive"?
3. There seems to be some inconsistencies between the highlighted comments and the code lines:
Code:
' Limit the trap area to range of cells in which [B][COLOR=#ff0000]completed dates[/COLOR][/B] are entered [B][COLOR=#ff0000]as defined above[/COLOR][/B]
If Not Intersect(Target, Range("rngTrigger")) Is Nothing Then
' Only trigger if the value entered is [B][COLOR=#ff0000]TRUE[/COLOR][/B]
If Target.Value = "[B][COLOR=#ff0000]Yes[/COLOR][/B]" Then
4. The "Resume Next" form of error handler may not be the best option, and having at the very end of your sub achieves little.
Rich (BB code):
On Error Resume Next
End Sub
5.
Code:
Dim [COLOR=#ff0000]rngDestQB [/COLOR]As Range
Set [COLOR=#ff0000]rngDestQB [/COLOR]= Worksheets("Q & B Archive").Range("[COLOR=#ff0000]rngDestQB[/COLOR]")
Dim [COLOR=#ff0000]rngTriggerQB [/COLOR]As Range
' Limit the trap area to range of cells in which Yes is entered as defined above
If Not Intersect(Target, Range("[COLOR=#ff0000]rngTriggerQB[/COLOR]")) Is Nothing Then
It is not necessary to create:
- unique VBA variables like "rngDestQB" and rngTriggerQB, and
- unique Defined Names like "rngDestQB" and "rngTriggerQB"
when using the same VBA variables name "rngDest" and "rngTrigger", and related Defined Names "rngDest" and "rngTrigger" (both created with Sheet scope), means all the code behind each sheet is the same (with less risk of creating errors, easier to debug, maintain, etc.)
6. I suggest the following changes to this section of code:
Application.EnableEvents = False
Target.EntireRow.Select
Selection.Cut '[Move down one row, below Selection.FormatConditions.Delete, as per previous post on this matter.]
Selection.FormatConditions.Delete
rngDestQB.Insert Shift:=xlDown '[See comment # 5 about variable name >> use "rngDest" rather than "rngDestQB"]
Selection.Delete
' Reset EnableEvents
Application.EnableEvents = True
7.
When I enter yes in the Trigger column on Prospects, if the Q & B Archive is present. If it is not present (deleted), Prospects works like a charm.
I'm not sure what you mean here.
If you set up this new workbook as per the instructions earlier in the thread I don't see why the presence or not of "Q & B Archive" has any impact on what you do in "Prospects".
In your case I believe you should have:
- operating/source sheets named "Prospects", "Submissions", and "Quoted & Bound" (each with with a Defined Name for the trigger range), and
- matching archive sheets named "Prospects ARCHIVE", "Subs ARCHIVE" and "Quote & Bound ARCHIVE" (each with a "sheet scoped" Defined Name for the destination range)
I hope that helps.