永发信息网

EXCEL VBA查找内容输入值

答案:2  悬赏:40  手机版
解决时间 2021-02-14 03:55
  • 提问者网友:我们很暧昧
  • 2021-02-13 21:09
条件1
C:I为数据范围
我要的结果每行10个结果(B10:K14)
最佳答案
  • 五星知识达人网友:酒者煙囻
  • 2021-02-13 21:35
Sub s()
    Const ct = 3
    Const ctuo = 40
    n = Cells(Rows.Count, 3).End(3).Row
    t = (Cells(n - 1, 3) + Cells(n, 3)) Mod 10
    c = 1
    k = n - 1
    Do While k > 1
        For i = 3 To ct + 2
            If (Cells(k, i) + Cells(k - 1, i)) Mod 10 = t Then
                [b10:k14].Item(c) = (Cells(k, i) + Cells(k + 1, i)) Mod 10
                c = c + 1
                If c > ctuo Then Exit Sub
            End If
        Next
        k = k - 1
    Loop
End Sub
全部回答
  • 1楼网友:几近狂妄
  • 2021-02-13 22:59
sub s()     with sheets("问3")         n = .cells(rows.count, 3).end(3).row         for i = 3 to 6             t = t & .cells(n, i)         next     end with     with sheets("问3我要的结果")         set rg = .[f14:h22]         if rg.find(t) is nothing then             .[e7].clear         else             .[e7] = t             .[e7].interior.colorindex = 6         end if     end with end sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯