更新时间:2023-02-16 21:22:37
将公式输入400个单元格将需要相当长的时间,如果要迭代所有单元格并将公式输入每个单元格他们。使用Excel自动填充机制要快得多。
Entering a formula into 400 cells is going to take quite some time if you're going to iterate over all cells and enter the formula into each of them. Using the Excel autofill mechanisms is much faster.
$ws.Range("B2").Formula = "=(A2/86400)+25569+(-5/24)"
$ws.Range("B2").AutoFill($ws.Range("B2:B400"), 0)