從系統下載檔案,
其中有幾個儲存格看似有空格,在討論區得到協助,建立如下VBA
For Each Rng In Selection
Rng = Trim(Application.Clean(Rng))
Next
先以clean再用trim來做刪除空格的整理,
但整理後仍無做開頭以1篩選的處理,
並用vlookup參照到此號碼
能否請看看是什麼狀況呢?
[attach]22707[/attach]作者: 准提部林 時間: 2015-12-5 09:49
Sub 刪除空格()
For Each Rng In Selection
Rng.Value = Trim(Application.Clean(Rng)) '加入.value表示Rng是Range
Next
End Sub
Sub 刪除空格() Dim Rng As Range '這是標準宣告
For Each Rng In Selection
Rng = Trim(Application.Clean(Rng))
Next
End Sub作者: c_c_lai 時間: 2015-12-5 09:56