>即時新聞-熱門

2009年9月14日星期一

excel -vba 合併

Sub 合併()

Dim SN
SN = Sheets.Count

For i = 2 To SN

Sheets(i).Select
If i = 2 Then

Cells(1, 1).Select

Else

Cells(2, 1).Select

End If


'Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Sheets(1).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select

Next
End Sub

0 评论:

 
妹咕數位學園歡迎網友們來信指教 妹咕信箱