elmnas
05-26-2015, 06:47 AM
Hello people
I should need help to correct the code I don't get the result I want.
in Column J and K If the text are equal like here "IND" and "IND"
then take value in Column B same row = (88) -1 / 12(Column B same row)
( present it in Column T same row
result = 8 in same row but Column T
see picture
13516
I want this result instead
13517
Here is my code
Sub test()
Dim i&, j&
Application.ScreenUpdating = False
With WorksheetFunction
For i = 1 To .Max(Cells(Rows.Count, "J").End(xlUp).Row, Cells(Rows.Count, "K").End(xlUp).Row)
If Cells(i, "J") = Cells(i, "K") And Len(Cells(i, "B")) <> 0 And Cells(i, "AB") <> 0 Then
j = j + 1
Cells(j, "T") = Cells(i, "B") - 1 / Cells(i, "AB")
End If
Next i
End With
End Sub
Could someone help me to correct my code?
Thank you in advance
I should need help to correct the code I don't get the result I want.
in Column J and K If the text are equal like here "IND" and "IND"
then take value in Column B same row = (88) -1 / 12(Column B same row)
( present it in Column T same row
result = 8 in same row but Column T
see picture
13516
I want this result instead
13517
Here is my code
Sub test()
Dim i&, j&
Application.ScreenUpdating = False
With WorksheetFunction
For i = 1 To .Max(Cells(Rows.Count, "J").End(xlUp).Row, Cells(Rows.Count, "K").End(xlUp).Row)
If Cells(i, "J") = Cells(i, "K") And Len(Cells(i, "B")) <> 0 And Cells(i, "AB") <> 0 Then
j = j + 1
Cells(j, "T") = Cells(i, "B") - 1 / Cells(i, "AB")
End If
Next i
End With
End Sub
Could someone help me to correct my code?
Thank you in advance