Truncate Left Characters in Cell Value
You would use the Mid (or Mid$ to return pure string values) and InStr
functions...
Answer = Mid$(CellText, InStr(CellText, "_"))
Note that, unlike the spreadsheet's MID function, you can omit the 3rd
argument... doing so returns the remainder of the string.
Rick
"Ray Clark" wrote in message
...
I have a number of text cells and I need to be able to truncate a number of
characters from the left hand side of the value. eg. MB99_Prod_PGP_Trans
needs to be truncated to "_Prod_PGP_Trans"
I am having trouble trying to find the VBA code to do this.
Can anyone help as I need to get this done in a hurry.
|