Comparing values of cells in a column with ComboBox value input by user

Viewed 1412

I am not able to compare the values of a cells in a column with combobox value input.

I have 2 workbooks tests(contains ComboBox2) and test1(contains a column whose cells are compared with ComboBox2.value)

I have a for loop to achieve this.

For i = 1 To LastRow

    If wkbSource.Worksheets(sheet_no).Cells(i, 1) = ComboBox2.Value Then
         'do something
    End If
Next i

I have debugged the code and I understood that if statement doesn't execute even after a match.

How can I fix it ?

EDIT :

Also I would like to know how you can add two cell values because directly adding it is showing incorrect output. For example

wkbSource.Worksheets(sheet_no).Cells(i, 1) + wkbSource.Worksheets(sheet_no).Cells(i, 3)

1 Answers
Related