我有一个问题,多维数组试图将日历层次结构中的组成员组合的ID(年 - >超级季节 - >季度 - >月 - >周)。问题是在特定周内要更改的周的ID号之一。比如根据屏幕截图,如果本周到来,ID /索引应该增加1
我必须为此问题修改的代码如下
Public Function writeStructure(intdimension As Integer) As Boolean
Dim objGroup As Variant
Dim objMember As Variant
Dim strError As String
Dim i As Integer
Dim j As Integer
On Error GoTo ErrorRoutine
writeStructure = False
'write structure
strError = "writing structure to " & readIniFileString("Dimensions", "Name" & intdimension, strControlFileIni)
With Worksheets(readIniFileString("Dimensions", "Name" & intdimension, strControlFileIni))
.Cells.Clear
i = 1
For Each objGroup In objGroups.Items
.Cells(i, 1).Value = objGroup.Number
.Cells(i, 2).Value = objGroup.Name
i = i + 1
Next
i = 1
For Each objMember In objMembers.Items
.Cells(i, 3).Value = objMember.Number
.Cells(i, 4).Value = objMember.Name
.Cells(i, 5).Value = objMember.Description
.Cells(i, 6).Value = objMember.Group
.Cells(i, 7).Value = objMember.groupName
For j = 1 To objMember.countOfParents
.Cells(i, 7 + j).Value = objMember.Parent(j) ' ID values are assigning
Next j
i = i + 1
Next
End With