>即時新聞-熱門

2009年9月24日星期四

EXCEL VBA - 整合2

Sub 整合()
x = InputBox("請輸入工作表數量")


For i = 1 To x

Sheets(i).Select

If i = 1 Then

Range("A1").Select

Else
Range("A2").Select

End If

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

Next


End Sub

0 评论:

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