本帖最后由 On_fire 于 2022-12-9 16:18 编辑
Sub demo2() Dim r, c, s With Sheet3 r =.UsedRange.Find(what:="*", LookIn:=xlValues, lookat:=xlWhole,searchorder:=xlByRows, searchdirection:=xlPrevious).Row c =.UsedRange.Find(what:="*", LookIn:=xlValues, lookat:=xlWhole,searchorder:=xlByColumns, searchdirection:=xlPrevious).Column arr =.Range("a1").Resize(r, c) For i = 5 ToUBound(arr) For j = 3 ToUBound(arr, 2) Step 2 Set s =Cells(i, j) IfCells(i, j) <> "" Then Mid(s, Len(s) - 2, 3) = VBA.StrReverse(Right(s, 3)) End If Next Next End With End Sub
|