我试图在Excel中运行包含以下VBA代码的宏:
Range("Results").ClearContents
For counter = 1 To 40
Range("constant") = -0.04 + counter * 0.005
Solve
Application.SendKeys ("{Enter}")
Range("Results").Cells(counter, 1) = ActiveSheet.Range("constant")
Range("Results").Cells(counter, 2) = ActiveSheet.Range("portfolio_sigma")
Range("Results").Cells(counter, 3) = ActiveSheet.Range("portfolio_mean")
Range("Results").Cells(counter, 4) = ActiveSheet.Range("x_1")
Range("Results").Cells(counter, 5) = ActiveSheet.Range("x_2")
Range("Results").Cells(counter, 6) = ActiveSheet.Range("x_3")
Range("Results").Cells(counter, 7) = ActiveSheet.Range("x_4")
Next counter
在运行时,我收到一条错误,指出SendKeys在Excel for Mac上不可用。对此最有效的替代方案/解决方法是什么?
答案 0 :(得分:1)