Question : I need to creat a scrubing macro for removing unnecesary characters on data

Hi,

I have some data issues and I need to generate rule data validation which will remove spaces, dashes, 0 and so on on my data on each table
I am placing some of examples on which the data has to be fixed
 S45676756 (removing null space at beginning)
",                  (Leaving blank or null)
*ICP07190NF3* (Removing * at the beginning and and the end)
148493-438 (Removing data after dashes)
15063-1
1-JMX1148L0B9 (remove this character "1-")
1IC-INM10261APQ (remove "1IC-")
1FTX1217A373 (remove 1 when the second character is a letter)
26A26178,255 (remove ",")
27474483. (remve ".")
88///11571  (remove "//")
CAT0934N1D1 (remove "CAT0")
UISCO1751-V (Remove "-V") the patter is everything after dash must be remove including dash
INC.FTX0946Y2LN (Remove "INC.")
S/N (Remove "S/N")
temp_270043939 (Remove "temp_")
INC-(Remove "INC-")
TEMPREDB (Replace by Null or empty)
000E075245893 (remove all ceros from the left)
03217-24 (Remove 0 from the left and "-24" everything after -24)
DUM- (Remove DUM- or leave blank)
W (Remove W or replace by null)
?DMY (Remove null)
0. (Remove 0.)
1.89E+11 (Remove or leave null)
2.24E+11










Just notice that these are some example on the data, so will be change but the patter is the same for all data
















Answer : I need to creat a scrubing macro for removing unnecesary characters on data

fncSplit = Right(strInput,Instr(strInput,"-") - 1) should have been:
fncSplit = Right(strInput,LEN(strInput)-Instr(strInput,"-") - 1)

Please keep in mind that you should experiment with the code,as I've already indicated, and many changes will be needed to optimize the algorithm to suit your needs and 100% won't be possible.

Nic;o)
Random Solutions  
 
programming4us programming4us