1
我有一个应用程序,它运行我需要加速的一段VBA
代码。在VBA中优化交替格式化
我环顾四周寻找解决方案,但它非常具体,我找不到任何东西。我将4-3000行的格式更改为可见性。这需要很长时间才能在旧计算机上运行,这是该进程通常运行的地方。你们对如何优化它有什么想法吗?
For i = Range(startCell).Row To Range(endCell).Row Step 2
Rows(i).Interior.color = RGB(50, 50, 50) 'Grey background
Rows(i).Font.color = RGB(0, 240, 255) 'Cyan text
Rows(i + 1).Interior.color = RGB(0, 0, 0) 'Black background
Rows(i + 1).Font.color = RGB(240, 255, 0) 'Yellow text
Next
退房[codereview.se]下一次你有工作代码。 – 2015-04-02 17:55:18
在哪里以及如何分配'startCell'和'endCell'? – 2015-04-02 17:58:59