TRIM function/remove spaces from cells using VBA

前端 未结 3 673
名媛妹妹
名媛妹妹 2021-02-08 05:43

I am using the code below to trim some \"blank cells\" that contain a space. The thing is it takes too much time, as is looping to every cell. What I want is to remove the spac

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-08 06:27

    For some reason Worksheetfunction.Trim does not remove the spaces, maybe because it has CRLF in it. In those cases Application.Clean function is the best method to choose.

提交回复
热议问题