看过你回答的怎样将excel中 1-9变为123456789?求助一个单元格里1-9、15-20这种怎么处理?1-9、17、19这种 20
1-9、15-20这种要变成1234567891516171819201-9、17、19这种1234567891719...
1-9、15-20这种要变成123456789151617181920
1-9、17、19这种1234567891719 展开
1-9、17、19这种1234567891719 展开
4个回答
展开全部
用字符串函数MID就可做到
追问
mid没用
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
例如输入123456789,先在相邻的单元格输入1.2鼠标拖在在2的单元格的右下角,出现+,然后再拖动+,要多少就有多少.1到n都可以,其余类似
更多追问追答
追问
我不是要1然后向下序列填充,要的是一个单元格里有多个这种几-几,把每一个几-几中间的数都列出来。
而且不是一个这种单元格。是有几百个。只能用公式。让他自己算出来。不能用手去一个一个向下拖。
追答
那就只有公式编辑器了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
用VBA处理。
原始值放于A2单元格,结果在A3单元格。
Sub 补数联数()
Dim AA, AB, BA, BB, CA, CC, DA, DD, EA, EE As String
AB = ""
BA = ""
CA = ""
DA = ""
EA = ""
i = 0
x = 0
y = 0
Sheets(1).Select
Range("B3").Select
Selection.NumberFormatLocal = "@"
AA = Cells(2, 2)
If InStr(AA, "、") = 0 Then
AB = AA
If InStr(AB, "-") > 0 Then
x = Left(AB, InStr(AB, "-") - 1)
y = Right(AB, Len(AB) - InStr(AB, "-"))
AB = x
For i = x + 1 To y
AB = AB & i
Next i
End If
ElseIf InStr(AA, "、") > 0 Then
AB = Left(AA, InStr(AA, "、") - 1)
If InStr(AB, "-") > 0 Then
x = Left(AB, InStr(AB, "-") - 1)
y = Right(AB, Len(AB) - InStr(AB, "-"))
AB = x
For i = x + 1 To y
AB = AB & i
Next i
End If
BB = Mid(AA, InStr(AA, "、") + 1)
If InStr(BB, "、") > 0 Then
BA = Left(BB, InStr(BB, "、") - 1)
If InStr(BA, "-") > 0 Then
x = Left(BA, InStr(BA, "-") - 1)
y = Right(BA, Len(BA) - InStr(BA, "-"))
BA = x
For i = x + 1 To y
BA = BA & i
Next i
End If
End If
CC = Mid(BB, InStr(BB, "、") + 1)
If InStr(CC, "、") > 0 Then
CA = Left(CC, InStr(CC, "、") - 1)
If InStr(CA, "-") > 0 Then
x = Left(CA, InStr(CA, "-") - 1)
y = Right(CA, Len(CA) - InStr(CA, "-"))
CA = x
For i = x + 1 To y
CA = CA & i
Next i
End If
End If
DD = Mid(CC, InStr(CC, "、") + 1)
If InStr(DD, "、") > 0 Then
DA = Left(DD, InStr(DD, "、") - 1)
If InStr(DA, "-") > 0 Then
x = Left(DA, InStr(DA, "-") - 1)
y = Right(DA, Len(DA) - InStr(DA, "-"))
DA = x
For i = x + 1 To y
DA = DA & i
Next i
End If
End If
EE = Mid(DD, InStr(DD, "、") + 1)
EA = EE
If InStr(EE, "-") > 0 Then
x = Left(EE, InStr(EE, "-") - 1)
y = Right(EE, Len(EE) - InStr(EE, "-"))
EA = x
For i = x + 1 To y
EA = EA & i
Next i
End If
End If
If EA <> "" Then
Cells(3, 2) = AB & BA & CA & DA & EA
ElseIf DA <> "" Then
Cells(3, 2) = AB & BA & CA & DA
ElseIf CA <> "" Then
Cells(3, 2) = AB & BA & CA
ElseIf BA <> "" Then
Cells(3, 2) = AB & BA
ElseIf AB <> "" Then
Cells(3, 2) = AB
End If
End Sub
原始值放于A2单元格,结果在A3单元格。
Sub 补数联数()
Dim AA, AB, BA, BB, CA, CC, DA, DD, EA, EE As String
AB = ""
BA = ""
CA = ""
DA = ""
EA = ""
i = 0
x = 0
y = 0
Sheets(1).Select
Range("B3").Select
Selection.NumberFormatLocal = "@"
AA = Cells(2, 2)
If InStr(AA, "、") = 0 Then
AB = AA
If InStr(AB, "-") > 0 Then
x = Left(AB, InStr(AB, "-") - 1)
y = Right(AB, Len(AB) - InStr(AB, "-"))
AB = x
For i = x + 1 To y
AB = AB & i
Next i
End If
ElseIf InStr(AA, "、") > 0 Then
AB = Left(AA, InStr(AA, "、") - 1)
If InStr(AB, "-") > 0 Then
x = Left(AB, InStr(AB, "-") - 1)
y = Right(AB, Len(AB) - InStr(AB, "-"))
AB = x
For i = x + 1 To y
AB = AB & i
Next i
End If
BB = Mid(AA, InStr(AA, "、") + 1)
If InStr(BB, "、") > 0 Then
BA = Left(BB, InStr(BB, "、") - 1)
If InStr(BA, "-") > 0 Then
x = Left(BA, InStr(BA, "-") - 1)
y = Right(BA, Len(BA) - InStr(BA, "-"))
BA = x
For i = x + 1 To y
BA = BA & i
Next i
End If
End If
CC = Mid(BB, InStr(BB, "、") + 1)
If InStr(CC, "、") > 0 Then
CA = Left(CC, InStr(CC, "、") - 1)
If InStr(CA, "-") > 0 Then
x = Left(CA, InStr(CA, "-") - 1)
y = Right(CA, Len(CA) - InStr(CA, "-"))
CA = x
For i = x + 1 To y
CA = CA & i
Next i
End If
End If
DD = Mid(CC, InStr(CC, "、") + 1)
If InStr(DD, "、") > 0 Then
DA = Left(DD, InStr(DD, "、") - 1)
If InStr(DA, "-") > 0 Then
x = Left(DA, InStr(DA, "-") - 1)
y = Right(DA, Len(DA) - InStr(DA, "-"))
DA = x
For i = x + 1 To y
DA = DA & i
Next i
End If
End If
EE = Mid(DD, InStr(DD, "、") + 1)
EA = EE
If InStr(EE, "-") > 0 Then
x = Left(EE, InStr(EE, "-") - 1)
y = Right(EE, Len(EE) - InStr(EE, "-"))
EA = x
For i = x + 1 To y
EA = EA & i
Next i
End If
End If
If EA <> "" Then
Cells(3, 2) = AB & BA & CA & DA & EA
ElseIf DA <> "" Then
Cells(3, 2) = AB & BA & CA & DA
ElseIf CA <> "" Then
Cells(3, 2) = AB & BA & CA
ElseIf BA <> "" Then
Cells(3, 2) = AB & BA
ElseIf AB <> "" Then
Cells(3, 2) = AB
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询