Sub dataProcess()
On Error Resume Next
For j = 3 To 20
Max = WorksheetFunction.Max(Range(Cells(2, j), Cells(4072, j)))
Min = WorksheetFunction.Min(Range(Cells(2, j), Cells(4072, j)))
For i = 2 To 4072
Cells(i, j) = (Cells(i, j) - Min) / (Max - Min)
Next
Next
End Sub
j是列数,i是行数
总行/列数也可以使用代码自动读取(num = ActiveSheet.UsedRange.Rows.Count)
ps. 用python还得换软件,VBA用熟了真的挺香。