B15:K24范围(注释修改范围为D19:Y45时,如何修改)
例:B15=00 B24=90149258 K19=056324489955
给单元内容每个字符+4(后面的也相加同样的字)
例结果:
B15=44 B24=34583692 K19=490768823399
excel vba给内容赋予值
答案:2 悬赏:80 手机版
解决时间 2021-03-19 18:19
- 提问者网友:末路
- 2021-03-18 19:23
最佳答案
- 五星知识达人网友:往事隔山水
- 2021-03-18 20:55
Sub test()
For i = 19 To 45
For j = 4 To 25
ce = Cells(i, j)
If IsNumeric(Cells(i, j)) And Len(ce) > 0 Then
Tmp = ""
For n = 1 To Len(ce)
Tmp = Tmp & (Mid(ce, n, 1) + 4) Mod 10
Next
Cells(i, j) = Tmp
End If
Next
Next
End Sub
For i = 19 To 45
For j = 4 To 25
ce = Cells(i, j)
If IsNumeric(Cells(i, j)) And Len(ce) > 0 Then
Tmp = ""
For n = 1 To Len(ce)
Tmp = Tmp & (Mid(ce, n, 1) + 4) Mod 10
Next
Cells(i, j) = Tmp
End If
Next
Next
End Sub
全部回答
- 1楼网友:你哪知我潦倒为你
- 2021-03-18 21:18
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 loopend sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯