Fortune Telling Collection - Zodiac Guide - Urgent! Excuse me, how to set the excel function formula in the excel table, so that the former table = the middle two words of the latter table?

Urgent! Excuse me, how to set the excel function formula in the excel table, so that the former table = the middle two words of the latter table?

First, customize a function under VBA. Details are as follows:

The following is a VBA custom function.

1, open a worksheet;

2. press ALT+F 1 1 (or execute tools-macro-VisualBasic editor);

3. Execute "Insert-Module", then double-click the newly inserted module and paste the following code into the window on the right.

4. If the content of A 1 is China Aerospace No.6 A, just enter =hztopy(A 1) in B 1.

Function hztopy(hzpy as a string) as a string.

Dim hzstring as string, pystring as string.

Dim hzpysum is an integer, hzi is an integer and hzpyhex is an integer.

hzstring = Trim(hzpy)

hzpysum = Len(Trim(hzstring))

pystring = " "

For hzi = 1 to hzpysum.

Hzpyhex = "& ampH"+hexadecimal (Asc(Mid(hzstring, hzi, 1)))

Select case hzpyhex

Case & amphb0a1to&; HB0C4: pystring = pystring + "A "

Case & Amphb0c5to & AmphbC20: pystring = pystring+"b"

Case & amphb2c1to&; HB4ED: pystring = pystring + "C "

Case & Amphb4EE to & Amphb6E9: pystring = pystring+"d"

Case & Amphb6EATO & Amphb7A1:pystring = pystring+"e"

Case & ampHB7A2 to & ampHB8C0: pystring = pystring+"F "

Case & ampHB8C 1 to & ampHB9FD: pystring = pystring+"G "

Case & Amphb9feto & Amphbbf6: pystring = pystring+"h"

Case & Amphbbf7to & AmphbfA5: pystring = pystring+"j"

Case & AmphbfA6to & Amphc0AB: pystring = pystring+"k"

Case & Amphc0acto & Amphc2e7: pystring = pystring+"l"

Case & Amphc2E8to & Amphc4C2: pystring = pystring+"m"

Case & ampHC4C3 to & ampHC5B5: pystring = pystring+"N "

Case & Amphc5b6to & Amphc5bd: pystring = pystring+"o"

Case & AmphC5BETO & Amphc6D9: pystring = pystring+"p"

Case & Amphc6Dato & Amphc8Ba: pystring = pystring+"q"

Case & hc8bbto & hc8f5: pystring = pystring+"r"

Case & ampHC8F6 to & ampHCBF9: pystring = pystring+"S "

Case & AmphcBFA to & Amphcdd9: pystring = pystring+"t"

Case & ampHEDC5: pystring = pystring+"T "

Case & Amphcddato & Amphcef 3: pystring = pystring+"w"

Case & ampHCEF4 to & amphd1b 8: pystring = pystring+"x"

Case & Amphd1B9to &; HD4D0: pystring = pystring + "Y "

Case & ampHD4D 1 to & hd7f9: pystring = pystring+"z"

Other cases

pystring = pystring + Mid(hzstring,hzi, 1)

End selection

then

hztopy = pystring

End function