Thank you in advance for taking your time to read through this and helping me. Part of the macro that I am working on should go through rows and compare values in the last two cells of the row (columns will be different for each row thus I can't just take the values in specific two columns to compare).
Later the macro will change values in other cells depending on the finding.
What I am having difficulties with is assigning the value of the last cell in the row and cell before last.
My code is:
Sub compareValues()
Dim allInLastRow As Long
Dim allInLastCol As Long
Dim i As Integer
Dim x As Integer
Dim allInWs As Worksheet
Set allInWs = ThisWorkbook.Worksheets("All In")
allInLastRow = allInWs.Range("C" & Rows.Count).End(xlUp).Row
For i = 2 To allInLastRow 'scans through all the rows
allInLastCol = allInWs.Cells(i, Columns.Count).End(xlToLeft).Column
For x = 1 To allInLastCol 'scans through all the columns in each row
'in here I need to have the condition that compares lastcell value to 2nd last cell value and this is the one I have a problem with
Next x
Next i
End Sub
Any nudge toward the right direction will be much appreciated. I would love to have an answer from google, but I can't really formulate the question in a way that it would make sense to the search engine :-)
Thank you once again for your help!