BrandynBlaze
New Member
- Joined
- Sep 20, 2012
- Messages
- 29
Hi all,
I have a program that performs a search that looks for a 4 digit account number within an 8 digit item number and if it matches the number it changes to the format to the formatting on my list (Which reflects what actions need to be taken for given account).
The search is extremely basic and works currently, but I'd like it to only consider the first 4 characters so that internal matches don't flag the item.
For instance account # is 6011:
I want it to match 60117806, but not 54601185.
I've tried using Left(current cell, 4) to limit the characters searched, but it's still returning internal matches for some reason...
All the other attempts I've made have prevented the program from executing fully, and I've spent all my aloted time to play around with it, so I'm hoping for some help.
I have a program that performs a search that looks for a 4 digit account number within an 8 digit item number and if it matches the number it changes to the format to the formatting on my list (Which reflects what actions need to be taken for given account).
The search is extremely basic and works currently, but I'd like it to only consider the first 4 characters so that internal matches don't flag the item.
For instance account # is 6011:
I want it to match 60117806, but not 54601185.
I've tried using Left(current cell, 4) to limit the characters searched, but it's still returning internal matches for some reason...
All the other attempts I've made have prevented the program from executing fully, and I've spent all my aloted time to play around with it, so I'm hoping for some help.
Code:
Sheet1.Cells.Replace _
What:=cell.Value Replacement:=cell.Value, _
SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True