- 帖子
- 522
- 主題
- 36
- 精華
- 1
- 積分
- 603
- 點名
- 0
- 作業系統
- win xp sp3
- 軟體版本
- Office 2003
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2012-12-13
- 最後登錄
- 2021-7-11
|
是這樣嗎?
試試看!!- 'Sheets("工作交接事項")_CommandButton1
- Private Sub CommandButton1_Click()
- UserForm1.Show
- End Sub
- 'UserForm1_CommandButton1
- Private Sub CommandButton1_Click()
- Dim sh As Worksheet, Rng As Range, MH
- Dim LstR As Integer
- Set sh = Sheets("工作交接事項")
- LstR = sh.[A2].End(xlDown).Row
- Set Rng = sh.[A2].Resize(LstR - 1, 1)
- MH = Application.Match(TextBox1.Value, Rng, 0)
- If IsNumeric(MH) Then
- TextBox2.Value = sh.Cells(MH + 1, "B") '反應日期
- TextBox3.Value = sh.Cells(MH + 1, "C") '反應人員
- '~~
- '~~
- End If
- End Sub
- 'UserForm1_CommandButton2
- Private Sub CommandButton2_Click() 'OK
- Unload Me
- End Sub
複製代碼 |
|