Re: [問題] ===300P! 請問一個excel VBA迴圈問題 ====
※ 引述《hahawin (haha)》之銘言:
: linxiaoxi大你好
: 我將
: Cells(i, 10).Value = "無"
: 取代IsEmpty(Cells(i, 2)) 帶入程式跑
: 發現 在
: Cells(i, 10).Value = "無"
: 和 Cells(i, 4)不是Error時
: 程式就會在那個i 無限迴圈了 = =
: ※ 引述《linxiaoxi (葡萄神手)》之銘言:
: : Sub Macro1()
: : For i = 1 To 100
: : If IsEmpty(Cells(i, 2)) And IsError(Cells(i, 2)) Then
: : i = i
: : ElseIf IsEmpty(Cells(i, 2)) And Not (IsError(Cells(i, 2))) Then
: : i = i - 1
: : End If
: : Next i
: : End Sub
: : 上面就是原po想要的代碼
: : 但是原po的想法,如果判斷的單元格為空且無錯,EXCEL界面會頓
這樣可以嗎?
If Cells(i, 10).Value = "無" Then
If Cells(i, 4).Value = "#VALUE!" Then
i = i
Else
i = i - 1
End If
Else
i = i
End If
新手發文,不行別鞭我..
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.85.118.200
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 4 之 5 篇):
Office 近期熱門文章
PTT數位生活區 即時熱門文章