我正在使用Vba在Excel上编辑报表工具,我在另一个工作表中创建了一个新的数据透视表,并希望使用此数据透视表的结果来编辑另一个工作表。但是我现在陷入了循环
Check the number of division for the LM
Divisions_Count.Select
CntRow = 2
Do While Divisions_Count.Cells(CntRow, 1).Value <> "Grand Total"
If Details.Cells(DetRow, 1).Value = Divisions_Count.Cells(CntRow, 1).Value Then
Nb_Div = Divisions_Count.Cells(CntRow, 2).Value
Else
CntRow = CntRow + 1
End If
Loop
答案 0 :(得分:0)
尝试一下:
Do While Divisions_Count.Cells(CntRow, 1).Value <> "Grand Total"
If Details.Cells(DetRow, 1).Value = Divisions_Count.Cells(CntRow, 1).Value Then
Nb_Div = Divisions_Count.Cells(CntRow, 2).Value
End If
CntRow = CntRow + 1
Loop
(未经测试)