AleemAM123
01-12-2009, 05:37 PM
Having a little problem (i think). I'm trying to check whether the are values in column R are similar to those in column D. So if in column D, I have 62TI_1308 and there is a 62TI_1308X in column R then I want the same row that 62TI_1308 but in column I to be set to the value of 62TI_1308X. I am not sure if I did it correctly but this is the coed I wrote:
Sub compareDCSerrorT()
'
' Macro written be Aleem Mohammed to determine if error check temperature tage is available frm the DCS
'
'
'
Dim rowcount As Long
Dim rowcount2 As Long
Dim i As Long
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
Range("a1").Select
Range(Selection, Selection.End(xlDown)).Select
rowcount = Selection.Count
Range("r1").Select
Range(Selection, Selection.End(xlDown)).Select
rowcount2 = Selection.Count
result = rowcount2
Do While rowcount > 0
Do While rowcount2 > 0
If Cells.Item(rowcount, 4).Value Like Cells.Item(rowcount2, 18).Value Then Cells.Item(rowcount, 9).Value = Cells.Item(rowcount2, 18).Value
rowcount2 = rowcount2 - 1
Loop
rowcount = rowcount - 1
rowcount2 = result
result = result - 1
Loop
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub
Sub compareDCSerrorT()
'
' Macro written be Aleem Mohammed to determine if error check temperature tage is available frm the DCS
'
'
'
Dim rowcount As Long
Dim rowcount2 As Long
Dim i As Long
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
Range("a1").Select
Range(Selection, Selection.End(xlDown)).Select
rowcount = Selection.Count
Range("r1").Select
Range(Selection, Selection.End(xlDown)).Select
rowcount2 = Selection.Count
result = rowcount2
Do While rowcount > 0
Do While rowcount2 > 0
If Cells.Item(rowcount, 4).Value Like Cells.Item(rowcount2, 18).Value Then Cells.Item(rowcount, 9).Value = Cells.Item(rowcount2, 18).Value
rowcount2 = rowcount2 - 1
Loop
rowcount = rowcount - 1
rowcount2 = result
result = result - 1
Loop
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub