类似于以下:Sub test()Dim i, j, ai = 1j = 2a = 10For x = j To j + aCells(i, x).Interior.ColorIndex = 3Cells(i, x) = "A"NextEnd Sub
条件格式就好了,没必要用到宏