|
我那个更新了下,
新增一列,标识出更改了地方:
Sub test()
Dim i As Integer
Range("B1") = "结果"
Application.ScreenUpdating = False
For i = 2 To Range("A65536").End(xlUp).Row
Range("B" & i).Select
If Not Range("a" & i).Find("kg", lookat:=xlPart) Is Nothing Then
ActiveCell.FormulaR1C1 = "=LEFT(RC[-1],SEARCH(""kg"",RC[-1])-1) * 1000 &""g"""
'标识更改的地方,黄底红字
With Selection.Interior
.Color = 65535
End With
With Selection.Font
.Color = -16776961
End With
ElseIf Range("a" & i).Find("kg", lookat:=xlPart) Is Nothing Then
ActiveCell.FormulaR1C1 = "=RC[-1]"
End If
Next
Application.ScreenUpdating = True
End Sub
|
|