任何人都可以幫助我尋找一種將代碼優化爲更短行的好方法嗎?請給我一個好的建議。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