VBABEGINER
Well-known Member
- Joined
- Jun 15, 2011
- Messages
- 1,284
- Office Version
- 365
- Platform
- Windows
I have new question here..
Please see my below code..
In red line code, I want to use Sheet2 now..How do i edit this..can any help..
Please see my below code..
In red line code, I want to use Sheet2 now..How do i edit this..can any help..
Code:
Dim FndTxt As Range, zVal As Range, Fnd As Long
Set FndTxt = Range("AA3")
[COLOR=#ff0000]For Each zVal In Range("Z501", Range("Z" & Rows.Count).End(xlUp))[/COLOR]
**** = WorksheetFunction.CountIf(Range("AA3", Cells(LastRow, LastCol)), zVal.Value)
If **** > 0 Then
For Fnd = 1 To ****
Set FndTxt = Range("AA3", Cells(LastRow, LastCol)).Find(What:=zVal.Value, After:=FndTxt, _
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
Range("A" & FndTxt.Row).Interior.Color = vbGreen
Next Fnd
End If
Next zVal