excel

Excel : Substract Character Sets

```We have two Columns A and B containing Industry codes and Excluded Industry code.
We need a third column C subtracting A and B.
Is There any formula to achieve this?
Industry |Excluded | Output
:------------------------------------------|:---------|:------
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U | P,L,K,L | ?OUTPUT
------------------------------------------ |----------|------
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U | P,L,K,L | ?OUTPUT
```
```Try the following User Defined Function:
Public Function Remove(s1 As String, s2 As String) As String
Dim s As String
ary = Split(s2, ",")
s = Replace(Replace(s1, " ", Chr(1)), ",", " ")
For Each a In ary
s = Replace(s, a, "")
Next a
s = Application.WorksheetFunction.Trim(s)
Remove = Replace(Replace(s, " ", ","), Chr(1), " ")
End Function
User Defined Functions (UDFs) are very easy to install and use:
ALT-F11 brings up the VBE window
ALT-I
ALT-M opens a fresh module
paste the stuff in and close the VBE window
If you save the workbook, the UDF will be saved with it.
If you are using a version of Excel later then 2003, you must save
the file as .xlsm rather than .xlsx
To remove the UDF:
bring up the VBE window as above
clear the code out
close the VBE window
To use the UDF from Excel:
=remove(A1,B1)
http://www.mvps.org/dmcritchie/excel/getstarted.htm
and
http://msdn.microsoft.com/en-us/library/ee814735(v=office.14).aspx
and for specifics on UDFs, see:
http://www.cpearson.com/excel/WritingFunctionsInVBA.aspx
Macros must be enabled for this to work!```

Encrypt Message

code
soft
python
ios
c
html
jquery
cloud
mobile