|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub 按钮1_Click()
- Application.ScreenUpdating = False
- arr = Application.Intersect(ActiveSheet.UsedRange, Columns("j:w"))
- For j = 2 To UBound(arr)
- If Len(arr(j, 1)) > 0 Then
- If Len(arr(j, 2)) <> 0 Then '
- str1 = ""
- For i = 2 To 10
- If Len(arr(j, i)) > 0 And InStr("*X", arr(j, i)) > 0 Then
- If Len(str1) = 0 Then
- str1 = """" & arr(1, i) & """"
- Else
- str1 = str1 & "和""" & arr(1, i) & """" & arr(1, i)
- End If
- End If
- Next i
- If Len(str1) = 0 Then
- arr(j, UBound(arr, 2)) = "ok"
- Else
- arr(j, UBound(arr, 2)) = "[停留在" & str1 & "]"
- End If
- End If
- End If
- Next j
- Application.Intersect(ActiveSheet.UsedRange, Columns("j:w")) = arr
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|