blairacuda
Technical User
hello all,
i have a function that replaces abbreviations in a sheet with the actual word(s) associated with the applicable abbreviation. the problem i'm running in to is which properties of the replace function to set.
code:
Sheets(shtName).Cells.Replace what:=abbreviation, replacement:=replacement, LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, ReplaceFormat:=False
my problem is this scenario: PIP vs PIPP. with LookAt set to xlPart it only reads a portion of the string and sees PIPP as matching PIP. if i use xlWhole for LookAt it looks at the whole string (and the abbreviation can be anywhere in the string picked up from a cell). is there a setting i can use to tell it to respect each individual "word" as separated by whitespace to find the abbreviation to replace?
thanks in advance.
CBlair
Crystal, InstallShield, branching out in other programming realms.
i have a function that replaces abbreviations in a sheet with the actual word(s) associated with the applicable abbreviation. the problem i'm running in to is which properties of the replace function to set.
code:
Sheets(shtName).Cells.Replace what:=abbreviation, replacement:=replacement, LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, ReplaceFormat:=False
my problem is this scenario: PIP vs PIPP. with LookAt set to xlPart it only reads a portion of the string and sees PIPP as matching PIP. if i use xlWhole for LookAt it looks at the whole string (and the abbreviation can be anywhere in the string picked up from a cell). is there a setting i can use to tell it to respect each individual "word" as separated by whitespace to find the abbreviation to replace?
thanks in advance.
CBlair
Crystal, InstallShield, branching out in other programming realms.