PDA

View Full Version : Lookup Text Value



barim
04-17-2017, 07:22 PM
The below piece of code is actually vlookup which pastes found value in place, exactly, it flips numbers. I am running into issue that my lookup value is not a number, it is a piece of text that has a corresponding numerical value. So, if I have ABC somewhere in column B, it should be replaced with 12345, exactly flipped in place. How can I tell this code to look for text values instead of numbers? Before, I was pulling numbers and replacing them with other numbers. Column B had to be strictly formatted to general or number in order for lookup to work.
Thanks.



For Each c1 In wb1.Sheets(1).Range("B2:B" & lrow1)
For Each c2 In wb2.Sheets(1).Range("B2:B" & lrow2)
If c1.Value = c2.Value Then
c2.Offset(0, 0).Value = c1.Offset(0, 3).Value