dim tmp() as stringbuf=trim(buf)tmp=split(trim," ")buf=join(tmp,"")buf就是你的ss

解决方案 »

  1.   

    用 replace 函数:replace(ss," ","")使用"" 代替" " 即可
      

  2.   

    Function DelSpace(ByVal TStr As String) As String
        Dim TempStr As String
        Dim TempInt As Integer
        TempInt = InStr(TStr, Space(1))
        Do While Not TempInt = 0
            TStr = VBA.Left(TStr, TempInt - 1) & VBA.Right(TStr, Len(TStr) - TempInt)
            TempInt = InStr(TStr, Space(1))
        Loop
        DelSpace = TStr
    End Function
      

  3.   

    y=ss
    y = Trim(y)
    这样就可以了。
      

  4.   

    agree with tanaya(蜡笔小新)
      

  5.   

    ss = "  dd   "
    ltrim(rtrim(ss))
      

  6.   

    replace(ss,"","")
    小新说得对