-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The following method of collecting a series of ranges in order to apply formatting/style once should be optimzed.
'instead of this which appears everywhere:
If rExistingRange Is Nothing Then
Set rExistingRange = oAddThisRange
Else
Set rExistingRange = oWorksheet.Application.Union(rExistingRange, oAddThisRange)
End If
'[...]
If Len(rExistingRange.Address) > 200 Then
oDict.Add rExistingRange, rExistingRange
Set rExistingRangeRange = Nothing
End if
'[...]
'later: loop through each range in the dictionary and .Style = xlWhateveruse this instead:
'new sub/function in cptCore_bas so it's available everywhere
Public Sub cptAddRange(ByRef oExistingRange As Excel.Range, ByRef oAddThisRange As Excel.Range)
'put existing logic (which is repeated everywhere) here, once
End Sub
'replace existing lines with simply
cptAddRange oExistingRange, oAddThisRangeexists in:
- Status/cptStatusSheet_bas.bas:34
- Metrics/cptDECM_bas.bas:16 [removed - not necessary]
- Status/cptStatusSheetImport_bas.bas:1
Todo:
- assign this issue
- label the issue for enhancement or bug
- label the issue with codemodule (so fixes can be aggregated and hotfixed together)
- checkout appropriate branch and create
topicbranch - design, code and test
- update codemodule <cpt_version>x.y.z</cpt_version>
- update CurrentVersions.xml manually
- commit changes prefix comment with
Issue #XXX - - merge
topicinto appropriate branch(es) and push - delete topic branch