Michael J
Michael J

Reputation: 33

Symbols after value of variable

I Have a code like:

For i = 1 To fRow
    ali = wbTarget.ActiveSheet.Cells(i, 14).Value

    For j = 1 To fRow
        If nwb.Sheets(1).Cells(j, 3).Value = ali

what exactly happens is:

  1. We give a value for variable "ali" that is in column 14.
  2. We compare that variable with another cell

Issue is:

Thank You very much!

Upvotes: 1

Views: 65

Answers (1)

Siddharth Rout
Siddharth Rout

Reputation: 149325

Change

If nwb.Sheets(1).Cells(j, 3).Value = ali

To

If nwb.Sheets(1).Cells(j, 3).Value = ali Or _
nwb.Sheets(1).Cells(j, 3).Value Like ali & "*" Then

Upvotes: 2

Related Questions