- 帖子
- 1
- 主題
- 1
- 精華
- 0
- 積分
- 2
- 點名
- 0
- 作業系統
- WIN7
- 軟體版本
- OFFICE 2010 plus
- 閱讀權限
- 10
- 註冊時間
- 2018-9-11
- 最後登錄
- 2018-11-7
|
vba語法簡化,求助
:dizzy: 請問一下各位大大
下面語法要如何簡化,好多好長
If cb1.Text = "" Then
sln1 = cb1.Text
Else
sln1 = cb1.Text + " "
End If
If time1.Text = "" Then
slt1 = time1.Text
Else
slt1 = time1.Text + "次 "
End If
If tb1.Text = "" Then
slm1 = tb1.Text
Else
slm1 = tb1.Text + "M "
End If
If cb2.Text = "" Then
sln2 = cb2.Text
Else
sln2 = cb2.Text + " "
End If
If time2.Text = "" Then
slt2 = time2.Text
Else
slt2 = time2.Text + "次 "
End If
If tb2.Text = "" Then
slm2 = tb2.Text
Else
slm2 = tb2.Text + "M "
End If
If cb3.Text = "" Then
sln3 = cb3.Text
Else
sln3 = cb3.Text + " "
End If
If time3.Text = "" Then
slt3 = time3.Text
Else
slt3 = time3.Text + "次 "
End If
If tb3.Text = "" Then
slm3 = tb3.Text
Else
slm3 = tb3.Text + "M "
End If |
|