ここでの答えは、XLSTART ローカル マシン ディレクトリに保存されている .xlam アドインを介してすべてのスプレッドシートにアクセスできるように、Excel でクリーンアップ マクロを作成することです。
この VBA コードはきれいではありませんが、魔法のように機能します: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Remove_unneeded()
' Remove_unneeded Macro
' Removes extraneous hash setup from SharePoint exported workbook
Dim Again As Integer
Dim Again1 As Range
On Error GoTo Nope
Set Again1 = Cells.Find(What:="?;#", LookAt:=xlPart)
If Again1 Is Nothing Then
Set Again1 = Cells.Find(What:=";#?", LookAt:=xlPart)
If Again1 Is Nothing Then
GoTo Nope
End If
End If
Range("A1").Select
Again = 1
Do While Again < 5
Set Again1 = Cells.Find(What:="0;#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="0;#", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="0;#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:="1;#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="1;#", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="1;#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:="2;#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="2;#", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="2;#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:="3;#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="3;#", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="3;#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:="4;#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="4;#", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="4;#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:="5;#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="5;#", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="5;#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:="6;#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="6;#", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="6;#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:="7;#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="7;#", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="7;#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:="8;#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="8;#", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="8;#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:="9;#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="9;#", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="9;#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:=";#0", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:=";#0", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:=";#0", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:=";#1", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:=";#1", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:=";#1", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:=";#2", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:=";#2", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:=";#2", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:=";#3", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:=";#3", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:=";#3", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:=";#4", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:=";#4", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:=";#4", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:=";#5", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:=";#5", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:=";#5", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:=";#6", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:=";#6", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:=";#6", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:=";#7", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:=";#7", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:=";#7", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:=";#8", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:=";#8", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:=";#8", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:=";#9", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:=";#9", Replacement:=";#", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:=";#9", LookAt:=xlPart)
Loop
Again = Again + 1
Loop
Set Again1 = Cells.Find(What:="#;#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="#;#", Replacement:=" | ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="#;#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:=";#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:=";#", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:=";#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:="#;", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="#;", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="#;", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:="#", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="#", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="#", LookAt:=xlPart)
Loop
Set Again1 = Cells.Find(What:="; |", LookAt:=xlPart)
Do While Not Again1 Is Nothing
Cells.Replace What:="; |", Replacement:=" |", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Set Again1 = Cells.Find(What:="; |", LookAt:=xlPart)
Loop
Range("A1").Select
MsgBox "Extraneous hash data has been deleted."
Exit Sub
Nope:
MsgBox "This is not the proper spreadsheet setup to run this macro."
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
また、iRibbon コントロールを使用して xlam に追加のマクロを作成し、Excel のカスタム リボンのボタンを介してこのマクロにアクセスし、それに対応するように xlam UI xml を編集しました。ただし、マクロを使用する準備ができたら、好きなように UI を設定できるため、これはウィンドウ ドレッシングです。
セキュリティ センターの [マクロ オプション] の [Excel のオプション] で [VBA プロジェクト オブジェクト モデルの信頼] をオンにする必要があります。もちろん、アドインにデジタル署名する機能がない限り。