Dim str As String Dim num1 As Long, num2 As Long, num3 As Long Dim cell As Range For Each cell In Range("F1:F7") str = cell.Value num1 = Val(Left(str, InStr(str, "×") - 1)) num2 = Val(Mid(str, InStr(str, "×") + 1, InStrRev(str, "×") - InStr(str, "×") - 1)) num3 = Val(Right(str, Len(str) - InStrRev(str, "×"))) cell.Offset(0, -5).Resize(1, 3).Value = Array(num1, num2, num3) Next cell

优化代码: Dim str As String Dim num1 As Long num2 As Long num3 As Long For i = 1 To 7 str = RangeF & iValue num1 = ValLeftstr InStrstr × - 1 num2 = ValMi

原文地址: https://www.cveoy.top/t/topic/fkTo 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录