[VBA ] For NEXT 問題
=============================原本的寫法=============================
Sub tghh()
Range("A2").Characters(Range("D2"), Range("E2")).Font.ColorIndex = 3
Range("A3").Characters(Range("D3"), Range("E3")).Font.ColorIndex = 3
Range("A4").Characters(Range("D4"), Range("E4")).Font.ColorIndex = 3
Range("A5").Characters(Range("D5"), Range("E5")).Font.ColorIndex = 3
Range("A6").Characters(Range("D6"), Range("E6")).Font.ColorIndex = 3
Range("A7").Characters(Range("D7"), Range("E7")).Font.ColorIndex = 3
Range("A8").Characters(Range("D8"), Range("E8")).Font.ColorIndex = 3
End Sub
===================For Next的版本無法執行====================
Sub tghh()
For I = 2 To 10 Step 1
Range("A" & I).Characters(Range("D" & I), Range("E" & I)).Font.ColorIndex = 3
Next I
End Sub
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 218.164.1.3
※ 文章網址: https://www.ptt.cc/bbs/Visual_Basic/M.1478413781.A.187.html
→
11/06 22:25, , 1F
11/06 22:25, 1F
→
11/06 22:25, , 2F
11/06 22:25, 2F
→
11/06 22:25, , 3F
11/06 22:25, 3F
→
11/06 22:32, , 4F
11/06 22:32, 4F
→
11/06 22:34, , 5F
11/06 22:34, 5F
→
11/06 23:19, , 6F
11/06 23:19, 6F
→
11/07 09:49, , 7F
11/07 09:49, 7F
→
11/09 03:28, , 8F
11/09 03:28, 8F
→
11/09 03:28, , 9F
11/09 03:28, 9F
→
11/09 03:28, , 10F
11/09 03:28, 10F
推
11/09 08:32, , 11F
11/09 08:32, 11F
→
11/09 08:34, , 12F
11/09 08:34, 12F
→
11/09 08:34, , 13F
11/09 08:34, 13F
→
11/09 21:40, , 14F
11/09 21:40, 14F
→
11/10 07:24, , 15F
11/10 07:24, 15F
→
11/10 10:19, , 16F
11/10 10:19, 16F
討論串 (同標題文章)
Visual_Basic 近期熱門文章
PTT數位生活區 即時熱門文章