任何人都可以帮助我寻找一种将代码优化为更短行的好方法吗?请给我一个好的建议。VBA Excel forLoop优化
With Selection
.Value = "Apple"
.Font.Bold = True
.Offset(1).Value = "Orange"
.Offset(1).Font.Bold = True
.Offset(2).Value = "Strawberry"
.Offset(2).Font.Bold = True
.Offset(3).Value = "Pear"
.Offset(3).Font.Bold = True
.Offset(4).Value = "Pineapple"
.Offset(4).Font.Bold = True
.Offset(5).Value = "Grape"
.Offset(5).Font.Bold = True
.Offset(6).Value = "Banana"
.Offset(6).Font.Bold = True
.Offset(8).Value = "Durian"
.Offset(8).Font.Bold = True
.Offset(8, 1).Value = "Rambutan"
.Offset(8, 1).Font.Bold = True
.Offset(8, 2).Value = "Dragonfruit"
.Offset(8, 2).Font.Bold = True
.Offset(8, 3).Value = "Mango"
.Offset(8, 3).Font.Bold = True
End With
如果您没有任何错误或具体的“如何”问题,那么优化问题更适合StackOverflow的[代码评论](http://codereview.stackexchange.com/)姊妹网站。 – 2014-10-10 02:39:07