我已在bolow要求,其中我已经取得了一些颜色的重复值,但我仍然需要一些帮助从一系列列的拆分值,并使用VB宏
- 如果G中列中的状态=就绪重新测试或通过
- 然后,如果有在列C的任何值,采取/拆分重复ID列C与逗号(,)隔开
- 搜索在列A的重复的ID以及与绿色色彩 其标记
[![示例数据] [1]] [1]
ex。在第1行中,缺陷ID CMS-921有两个重复的id 44和163693.所以我需要在列A中查找这些值。
- 如果这些缺陷的状态(44和163693)不然后关闭我需要标记整个行中的绿颜色的我当前的代码
实施例:
Sub findduplicateColorIt()
Get the last row
Dim Report As Worksheet
Dim i As Integer, j As Integer
Dim lastRow As Integer
Set Report = Excel.Worksheets("Sheet2")
lastRow = Report.UsedRange.Rows.Count
Application.ScreenUpdating = False
For i = 2 To lastRow
For j = 2 To lastRow
If Report.Cells(i, 4).Value <> ""_
And Report.Cells(i, 7).Value = "Ready to retest"_
And Report.Cells(i, 1).Value = "Jira" Then
'This will omit blank cells at the end
'(in the event that the column lengths are not equal).
If InStr(1, Report.Cells(j, 2).Value, Report.Cells(i, 3).Value, vbTextCompare) > 0 Then
' need to get a logic where i need to get value from Colum D,
'split it and find the value in column A and color the row with green/any.
a = Split(ActiveCell.Value, ",")
For Text = 0 To UBound(a)
MsgBox a(Text)
Next Text
Exit For
Else
End If
End If
Next j
Next i
Application.ScreenUpdating = True
End Sub
你究竟在做什么问题? (发现重复项,分割值,for循环不起作用等) –
看起来你有一个“Else”,它没有做任何事情。 –
@CodyG。现在数组a = Split(ActiveCell.Value,“,”)具有多个值,现在我需要从(i)中取个别值并在列B中搜索并为整行着色..我无法获得逻辑为... – Venkat