|    | 
     ▼はる さん: 
 
こんばんは 
 
スペースですかぁ。 
外部から取り込んだデータなんでしょうかね。 
そうするとスペース以外の「ゴミ」もあるかもですね。 
 
以下を試してみてください。 
 
Sub Sample3_3() 
  'ちょっと横着バージョンの改訂版 
  Dim i As Long 
  
  With ActiveSheet.UsedRange 
    .Replace What:=" ", Replacement:="", LookAt:=xlPart 
    .Replace What:=" ", Replacement:="", LookAt:=xlPart 
  End With 
  i = Range("A1").CurrentRegion.Rows.Count + 1 
  Rows(i & ":" & Rows.Count).ClearContents 
  
End Sub 
 
 
Sub Sample3_4() 
  'Sample3_3でもだめなら 
  Dim i As Long 
  Dim c As Range 
   
  With ActiveSheet.UsedRange 
    For Each c In .Cells 
      c.Value = WorksheetFunction.Clean(c.Value) 
    Next 
    .Replace What:=" ", Replacement:="", LookAt:=xlPart 
    .Replace What:=" ", Replacement:="", LookAt:=xlPart 
  End With 
  i = Range("A1").CurrentRegion.Rows.Count + 1 
  Rows(i & ":" & Rows.Count).ClearContents 
  
End Sub 
 | 
     
    
   |