- 帖子
- 13
- 主題
- 1
- 精華
- 0
- 積分
- 15
- 點名
- 0
- 作業系統
- W10
- 軟體版本
- 2010
- 閱讀權限
- 10
- 性別
- 男
- 註冊時間
- 2022-5-28
- 最後登錄
- 2022-6-1
|
匯入總表數據bug
各位大大好,初來乍到想詢問一個程式語言
小弟遇到狀況如下
1.將5個專案分別以複製方式貼上"經管表格" (OK)
2.貼上後再將C欄選取範圍匯入"總表" (不OK)
不OK的原因是...
當匯入過去後,全部數值會變成一樣的(求解)
因為寫的這個程式碼感覺很暴力,是否有比較簡單的寫法?(求解)
以下是程式碼,再麻煩各位協助除錯!!! 感恩感恩
Sub summary2()
工作表1.Activate
'If Sheet <> 專案 Then Exit Sub '非有專案的標題 不動作
For j = 3 To 7
For i = 2 To 6
Range("B3:D58").ClearContents
Sheets(j).Range("B3:D58").Copy Destination:=[b3]
工作表7.Cells(4, i) = [c3]
工作表7.Cells(5, i) = [c5]
工作表7.Cells(6, i) = [c6]
工作表7.Cells(7, i) = [c7]
工作表7.Cells(8, i) = [c8]
工作表7.Cells(9, i) = [c9]
工作表7.Cells(10, i) = [c10]
工作表7.Cells(11, i) = [c11]
工作表7.Cells(12, i) = [c12]
工作表7.Cells(13, i) = [c13]
工作表7.Cells(14, i) = [c14]
工作表7.Cells(15, i) = [c15]
工作表7.Cells(16, i) = [c16]
工作表7.Cells(17, i) = [c17]
工作表7.Cells(18, i) = [c18]
工作表7.Cells(19, i) = [c19]
工作表7.Cells(20, i) = [c20]
工作表7.Cells(21, i) = [c21]
工作表7.Cells(22, i) = [c22]
工作表7.Cells(23, i) = [c23]
工作表7.Cells(24, i) = [c24]
工作表7.Cells(25, i) = [c25]
工作表7.Cells(26, i) = [c26]
工作表7.Cells(27, i) = [c27]
工作表7.Cells(28, i) = [c28]
工作表7.Cells(29, i) = [c29]
工作表7.Cells(30, i) = [c30]
工作表7.Cells(31, i) = [c31]
工作表7.Cells(32, i) = [c32]
工作表7.Cells(33, i) = [c33]
工作表7.Cells(34, i) = [c34]
工作表7.Cells(35, i) = [c35]
工作表7.Cells(36, i) = [c36]
工作表7.Cells(37, i) = [c37]
工作表7.Cells(38, i) = [c38]
工作表7.Cells(39, i) = [c39]
工作表7.Cells(40, i) = [c40]
工作表7.Cells(41, i) = [c41]
工作表7.Cells(42, i) = [c42]
工作表7.Cells(43, i) = [c43]
工作表7.Cells(44, i) = [c44]
工作表7.Cells(45, i) = [c45]
工作表7.Cells(46, i) = [c46]
工作表7.Cells(47, i) = [c47]
工作表7.Cells(48, i) = [c48]
工作表7.Cells(49, i) = [c49]
工作表7.Cells(50, i) = [c50]
工作表7.Cells(51, i) = [c51]
工作表7.Cells(52, i) = [c52]
工作表7.Cells(53, i) = [c53]
工作表7.Cells(54, i) = [c54]
工作表7.Cells(55, i) = [c55]
工作表7.Cells(56, i) = [c56]
工作表7.Cells(57, i) = [c57]
工作表7.Cells(58, i) = [c58]
Next
Next
工作表7.Activate
End Sub |
-
-
圖片.png
(276.44 KB)
匯入順序
-
-
圖片2.jpeg
(184.5 KB)
數值都是一樣的
-
-
圖片3.PNG
(9.85 KB)
工作表數量
|