Dim b, s, m, c, n, sh, mh dz = Selection.Address b = Len(dz) - Len(Replace(dz, "$", "")) If b > 2 Then s = Len(dz) m = "" For c = 1 To s n = Mid(dz, c, 1) If IsNumeric(n) = True Then m = m & n 'IsNumeric的作用判断是否是数字 If n = ":" Then sh = m If n = ":" Then m = "" If c = s Then mh = m Next c Else s = Len(dz) m = "" For c = 1 To s n = Mid(dz, c, 1) If IsNumeric(n) = True Then m = m & n 'IsNumeric的作用判断是否是数字 Next c sh = m mh = m End If