HI gyus 
I'm strugling with one Macro, which should compare 2 cells in 2 different columns but it's actually doing nothing for unknown reason :-(
Macro should the following:
Loop throug the Column E and compare each cell from E3 untill Las row with each cell in columns G untill last row. Once is above, to go to AIT sheet and write "Point above the control limit " in column "D".
Is there anybody whoc could help me with that? :-)
Thanks,
Andy
Sub Test()
Dim Obj_Chart As chart
Dim Lng_Last As Long
Dim Lng_LastRow As Long
Dim Lng_First As Long
Dim Int_First As Integer
Dim Int_Last As Integer
'============================================'
'''' Point above contol limit ''''
'============================================'
Lng_LastRow = wshAIT.Range("A65536").End(xlUp).Row + 1
For Int_First = 3 To Lng_Last
If ShtMonthlyData.Range("E" & Int_First).Value > ShtMonthlyData.Range("G3").Value Then
If Lng_LastRow = 2 Then
wshAIT.Range("A" & Lng_LastRow + 1).Value = 1
Else
wshAIT.Range("A" & Lng_LastRow).Value = wshAIT.Range("A" & Lng_LastRow - 1).Value + 1
End If
wshAIT.Range("B" & Lng_LastRow).Value = ShtMonthlyData.Range("B" & Int_First + 1).Value
wshAIT.Range("C" & Lng_LastRow).Value = ShtMonthlyData.Range("E2")
wshAIT.Range("D" & Lng_LastRow).Value = "Point above the control limit"
End If
Next
End Sub
Bookmarks