ArizonaEmployee
New Member
- Joined
- Sep 16, 2014
- Messages
- 2
Hello,
Thank you for your help in advance.
I've got two things I'm specifically looking for help on, and also appreciate any recommendations.
Thank you much!
Thank you for your help in advance.
I've got two things I'm specifically looking for help on, and also appreciate any recommendations.
1. I'm having trouble getting the .find function working below - which is bold and underlined
2. I'm wondering if the 'IF' statment below the .find function (underlined) should be written as MatchRow.offset(x,x).value = [xx]
Definitely open for recommendations, as I feel there is a better way to achieve the objective; the objective is to find rows with "UE" and no color (-4142), then use the dollar amounts to see if there are any offsetting amounts in the same data set with a few differences ("AB", etc). If found, then highlight both values pink (26).
Code:
Dim TCfind As Currency
Dim LCfind As Currency
Dim GCfind As Currency
Dim CurrentPC As String
Dim Loop13Row As Long
Dim CurrentRow As Integer
Dim CurrentRowSelect As Range
Dim MatchRow As Object
Dim MatchRowSelect As Object
Dim g As Integer
Dim Matches As Integer
Loop13Row = LastRowGJLI
i = 2
For i = 2 To Loop13Row
g = 1
Range("L" & [i]).Activate
If ActiveCell.Value = "UE" And ActiveCell.Interior.ColorIndex = -4142 Then
TCfind = ActiveCell.Offset(0, 8)*-1
LCfind = ActiveCell.Offset(0, 10)*-1
GCfind = ActiveCell.Offset(0, 12)*-1
CurrentPC = ActiveCell.Offset(0, -6)
CurrentRow = ActiveCell.Row
Set CurrentRowSelect = Cells(CurrentRow, "A")
Matches = Application.WorksheetFunction.CountIf(Range("T2", "T" & LastRowGJLI), [TCfind])
If Matches > 0 Then
For g = 1 To Matches
[B][U]Set MatchRow = Range("T" & i, "T" & LastRowGJLI).Find(What:=[TCfind])
[/U][/B] [U] If Cells(MatchRow, "F") = CurrentPC And _
Cells(MatchRow, "V") = LCfind And _
Cells(MatchRow, "X") = GCfind And _
Cells(MatchRow, "L") = "AB" Then[/U]
CurrentRowSelect.EntireRow.Interior.ColorIndex = 26
MatchRow.EntireRow.Interior.ColorIndex = 26
End If
Next g
End If
End If
Next i