'''
Sub RemoveSpacesFromFirstRowAndSpecificColumn()
Dim ws As Worksheet
Dim cell As Range
Dim targetColumn As Integer
For Each ws In ThisWorkbook.Worksheets
' 1行目の全てのセルに対してスペース削除
For Each cell In ws.Range(ws.Cells(1, 1), ws.Cells(1, ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column))
cell.Value = Replace(cell.Value, " ", "")
cell.Value = Replace(cell.Value, Chr(12288), "")
Next cell
' "取引先名"列を見つける
For i = 1 To ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column
If ws.Cells(1, i).Value = "取引先名" Then
targetColumn = i
Exit For
End If
Next i
' "取引先名"列の各セルに対してスペース削除
If targetColumn > 0 Then
For Each cell In ws.Range(ws.Cells(2, targetColumn), ws.Cells(ws.Rows.Count, targetColumn).End(xlUp))
cell.Value = Replace(cell.Value, " ", "")
cell.Value = Replace(cell.Value, Chr(12288), "")
Next cell
End If
Next ws
End Sub
'''