Sub DelSpace() For Each x In Selection.Cells srcStr = x.Value outStr = "" For i = 1 To Len(srcStr) c = Mid(srcStr, i, 1) If c <> " " Then outStr = outStr & c Next i x.Value = outStr Next x End Sub
答案:把選擇範圍中所有儲存格裡的空白字元刪掉。
是在問讀者看不看得懂程式。都有 caculater 了,為何小學還要教四則計算?