excel函數或vba如何將壹組數據分成n組數據?高分求助!
Sub test() Dim InCell As String '輸入的單元格Dim InElementNumber As Integer '需要重新定義Dim Aims_Arr()的行數。As String '用於存儲分組數據的數組Dim RowNumber As Integer '原始數據編號Dim GroupNumber As Integer '原始數據可以按照重新定義的編號分成若幹組'輸入單元格所在的列。InCell = InputBox("請輸入數據所在列的單元格,樣式如a 1 ")in element number = InputBox("請輸入每行排列多少個數字")RowNumber = Range(單元格內)。當前區域。行。CountIncolumn = left(在單元格中,1)group number = Application。ceiling(row number/inelement number,1)ReDim Aims _ Arr(1 To group number)B = 1 ' A是記錄數組中每個元素拼接了多少個值' B是記錄t = 1到組號Aims _ Arr(t)= " " A = 1 I = B到行號如果A