Dim a(), b(), c() As String, n, s, i
n = 0
Open "c:\1txt" For Input As #1
While Not EOF(1)
Line Input #1, s
c = Split(s, "=")
If UBound(c) = 1 Then
ReDim Preserve a(n), b(n)
a(n) = Trim(c(0))
b(n) = Trim(c(1))
n = n + 1
End If
Wend
Close #1
Text2 = Text1
For i = 0 To n - 1
Text2 = Replace(Text2, a(i), b(i))
Next
End Sub
法一:=CHOOSE(A1,"张三","李四","王麻子")
法二:=if(A1=1,"张三",if(A1=2,"李四","王麻子"))
法三:=lookup(A1,{1,2,3},{"张三","李四","王麻子"})
应该还有其他的一些方法,先这样了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)