Sub 货币符号处理()
Dim arr, i, j, k, m
i = Range("A1").End(xlToRight).Column
For j = 1 To i
If Cells(1, j) = "网站价格" Or Cells(1, j) = "买入价格" Then
Cells(1, j).EntireColumn.Insert
Cells(1, j) = "货币英文缩写"
End If
Next
arr = Range("A1").CurrentRegion
i = UBound(arr)
k = Left(Cells(2, 6), 1)
m = Left(Cells(46, 6), 1)
For j = 2 To i
If Left(arr(j, 6), 1) = k Then
arr(j, 5) = "GBP"
arr(j, 6) = Right(arr(j, 6), Len(arr(j, 6)) - 1)
End If
If Left(arr(j, 6), 1) = m Then
arr(j, 5) = "USD"
arr(j, 6) = Right(arr(j, 6), Len(arr(j, 6)) - 1)
End If
Next
Range("A1").Resize(i, UBound(arr, 2)) = arr
Range(Cells(2, 6), Cells(i, 6)).NumberFormatLocal = "G/通用格式"
End Sub |