|
因为表里有公式,改成下面这样试试。- Public shArr()
- Public wb As Object
- Sub bbb(sht$)
- Dim i&, ii&, tmp$, s, arr1()
-
- 'On Error Resume Next
- With Sheets(sht)
- Application.Calculation = xlCalculationManual
- If .AutoFilterMode Then .UsedRange.AutoFilter
- arr1 = .[a7].Resize(.[a65536].End(3).Row - 6, 78).Formula
- For i = 1 To UBound(arr1)
- For ii = 1 To UBound(arr1, 2)
- tmp = arr1(i, ii)
- If Len(tmp) Then
- If Not tmp Like "=*" Then
- If arr1(i, ii) Like "* 00" Then
- s = Split(tmp)
- If UBound(s) Then
- arr1(i, ii) = s(0)
- End If
- Else
- arr1(i, ii) = WorksheetFunction.Trim(tmp)
- End If
- End If
- End If
- Next
- Next
- .[d7].Resize(UBound(arr1)).NumberFormatLocal = "@"
- .[a7].Resize(UBound(arr1), 78).Value = arr1
- Application.Calculation = xlCalculationAutomatic
- End With
- End Sub
复制代码 |
|