- 帖子
- 396
- 主題
- 12
- 精華
- 0
- 積分
- 425
- 點名
- 0
- 作業系統
- Win10
- 軟體版本
- Office 2016
- 閱讀權限
- 20
- 性別
- 男
- 來自
- 台中
- 註冊時間
- 2013-7-2
- 最後登錄
- 2024-8-23
  
|
回復 9# lichang
sorry,改這樣應該就行了- Private Sub CommandButton1_Click()
- Dim Col As Integer
- Col = Sheets("工作表1").[a1].End(xlToRight).Column + 1
- Cells(1, Col) = TextBox1.Value
- Cells(2, Col) = TextBox2.Value
- Cells(3, Col) = TextBox3.Value
- Range(Cells(1, 2), Cells(3, [iv3].End(1).Column)).Select
- Selection.Sort Key1:=Range("b1"), Order1:=xlAscending, Header:=xlGuess, _
- OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, SortMethod _
- :=xlStroke, DataOption1:=xlSortNormal
- End Sub
複製代碼 |
|