2015年8月21日 星期五

0821 note

最後一筆資料
Private Sub CommandButton1_Click()
    Sheets(4).Cells(Rows.Count, 1).End(xlUp).Select
End Sub
最後一個欄位
Private Sub CommandButton2_Click()
    Dim s As String
    Dim kath As String
    Dim h As Variant
 
   ' s = Sheets(4).Cells(Rows.Count, 1).End(xlUp).End(xlUp).Value
    'msgbox s
    Sheets(4).Cells(Rows.Count, 1).End(xlUp).End(xlUp).Select
    kpath = Selection.Address
    'msgbox kpath
    h = Split(kpath, "$")
    'MsgBox h(2)
    Sheets(4).Cells(h(2), Columns.Count).End(xlToLeft).Select
 
   'Sheets(4).Cells(7, Columns.Count).End(xlToLeft).Select
End Sub

沒有留言:

張貼留言