Excel VBA質問箱 IV

当質問箱は、有志のボランティア精神のおかげで成り立っています。
問題が解決したら、必ずお礼をしましょうね。
本サイトの基本方針をまとめました。こちら をご一読ください。

投稿種別の選択が必要です。ご注意ください。
迷惑投稿防止のため、URLの入力を制限しています。ご了承ください。


27498 / 76732 ←次へ | 前へ→

【54553】マクロを短くしたい
質問  わんわん  - 08/3/18(火) 23:40 -

引用なし
パスワード
   マクロ初心者です。

行のデータを表に表示をしています。
以下のマクロを短くしたいのですが方法が分かりません

'コピー元(印刷)から(一覧)へ値を写す

 With Sheets("一覧")

  '照会データ
 
 .Cells(1, 4) = Sheets("印刷").Cells(6, 4)
.Cells(43, 5) = Sheets("印刷").Cells(6, 5)
.Cells(43, 8) = Sheets("印刷").Cells(6, 6)
.Cells(1, 15) = Sheets("印刷").Cells(6, 8)
.Cells(44, 6) = Sheets("印刷").Cells(6, 9)
.Cells(1, 10) = Sheets("印刷").Cells(6, 10)
.Cells(2, 18) = Sheets("印刷").Cells(6, 28)
.Cells(2, 16) = Sheets("印刷").Cells(6, 28)
.Cells(1, 8) = Sheets("印刷").Cells(6, 41)

'1行
 .Cells(3, 6) = Sheets("印刷").Cells(6, 2)
 .Cells(3, 7) = Sheets("印刷").Cells(6, 3)
 .Cells(3, 2) = Sheets("印刷").Cells(6, 14)
 .Cells(3, 11) = Sheets("印刷").Cells(6, 26)
 .Cells(3, 16) = Sheets("印刷").Cells(6, 29)
 .Cells(3, 17) = Sheets("印刷").Cells(6, 30)
 .Cells(3, 19) = Sheets("印刷").Cells(6, 31)
 .Cells(3, 12) = Sheets("印刷").Cells(6, 32)
 .Cells(3, 13) = Sheets("印刷").Cells(6, 33)
 .Cells(3, 15) = Sheets("印刷").Cells(6, 34)
 .Cells(3, 8) = Sheets("印刷").Cells(6, 36)
 .Cells(4, 8) = Sheets("印刷").Cells(6, 38)
 .Cells(3, 9) = Sheets("印刷").Cells(6, 39)
 .Cells(4, 9) = Sheets("印刷").Cells(6, 41)
 .Cells(3, 10) = Sheets("印刷").Cells(6, 42)
 
 '2行
 .Cells(5, 6) = Sheets("印刷").Cells(7, 2)
 .Cells(5, 7) = Sheets("印刷").Cells(7, 3)
 .Cells(5, 2) = Sheets("印刷").Cells(7, 14)
 .Cells(5, 11) = Sheets("印刷").Cells(7, 26)
 .Cells(5, 16) = Sheets("印刷").Cells(7, 29)
 .Cells(5, 17) = Sheets("印刷").Cells(7, 30)
 .Cells(5, 19) = Sheets("印刷").Cells(7, 31)
 .Cells(5, 12) = Sheets("印刷").Cells(7, 32)
 .Cells(5, 13) = Sheets("印刷").Cells(7, 33)
 .Cells(5, 15) = Sheets("印刷").Cells(7, 34)
 .Cells(5, 8) = Sheets("印刷").Cells(7, 36)
 .Cells(6, 8) = Sheets("印刷").Cells(7, 38)
 .Cells(5, 9) = Sheets("印刷").Cells(7, 39)
 .Cells(6, 9) = Sheets("印刷").Cells(7, 41)
 .Cells(5, 10) = Sheets("印刷").Cells(7, 42)
 
 '3行
 .Cells(7, 6) = Sheets("印刷").Cells(8, 2)
 .Cells(7, 7) = Sheets("印刷").Cells(8, 3)
 .Cells(7, 2) = Sheets("印刷").Cells(8, 14)
 .Cells(7, 11) = Sheets("印刷").Cells(8, 26)
 .Cells(7, 16) = Sheets("印刷").Cells(8, 29)
 .Cells(7, 17) = Sheets("印刷").Cells(8, 30)
 .Cells(7, 19) = Sheets("印刷").Cells(8, 31)
 .Cells(7, 12) = Sheets("印刷").Cells(8, 32)
 .Cells(7, 13) = Sheets("印刷").Cells(8, 33)
 .Cells(7, 15) = Sheets("印刷").Cells(8, 34)
 .Cells(7, 8) = Sheets("印刷").Cells(8, 36)
 .Cells(8, 8) = Sheets("印刷").Cells(8, 38)
 .Cells(7, 9) = Sheets("印刷").Cells(8, 39)
 .Cells(8, 9) = Sheets("印刷").Cells(8, 41)
 .Cells(7, 10) = Sheets("印刷").Cells(8, 42)

 '4行
 .Cells(9, 6) = Sheets("印刷").Cells(9, 2)
 .Cells(9, 7) = Sheets("印刷").Cells(9, 3)
 .Cells(9, 2) = Sheets("印刷").Cells(9, 14)
 .Cells(9, 11) = Sheets("印刷").Cells(9, 26)
 .Cells(9, 16) = Sheets("印刷").Cells(9, 29)
 .Cells(9, 17) = Sheets("印刷").Cells(9, 30)
 .Cells(9, 19) = Sheets("印刷").Cells(9, 31)
 .Cells(9, 12) = Sheets("印刷").Cells(9, 32)
 .Cells(9, 13) = Sheets("印刷").Cells(9, 33)
 .Cells(9, 15) = Sheets("印刷").Cells(9, 34)
 .Cells(9, 8) = Sheets("印刷").Cells(9, 36)
 .Cells(10, 8) = Sheets("印刷").Cells(9, 38)
 .Cells(9, 9) = Sheets("印刷").Cells(9, 39)
 .Cells(10, 9) = Sheets("印刷").Cells(9, 41)
 .Cells(9, 10) = Sheets("印刷").Cells(9, 42)

 '5行
 .Cells(11, 6) = Sheets("印刷").Cells(10, 2)
 .Cells(11, 7) = Sheets("印刷").Cells(10, 3)
 .Cells(11, 2) = Sheets("印刷").Cells(10, 14)
 .Cells(11, 11) = Sheets("印刷").Cells(10, 26)
 .Cells(11, 16) = Sheets("印刷").Cells(10, 29)
 .Cells(11, 17) = Sheets("印刷").Cells(10, 30)
 .Cells(11, 19) = Sheets("印刷").Cells(10, 31)
 .Cells(11, 12) = Sheets("印刷").Cells(10, 32)
 .Cells(11, 13) = Sheets("印刷").Cells(10, 33)
 .Cells(11, 15) = Sheets("印刷").Cells(10, 34)
 .Cells(11, 8) = Sheets("印刷").Cells(10, 36)
 .Cells(12, 8) = Sheets("印刷").Cells(10, 38)
 .Cells(11, 9) = Sheets("印刷").Cells(10, 39)
 .Cells(12, 9) = Sheets("印刷").Cells(10, 41)
 .Cells(11, 10) = Sheets("印刷").Cells(10, 42)

 '6行
 .Cells(13, 6) = Sheets("印刷").Cells(11, 2)
 .Cells(13, 7) = Sheets("印刷").Cells(11, 3)
 .Cells(13, 2) = Sheets("印刷").Cells(11, 14)
 .Cells(13, 11) = Sheets("印刷").Cells(11, 26)
 .Cells(13, 16) = Sheets("印刷").Cells(11, 29)
 .Cells(13, 17) = Sheets("印刷").Cells(11, 30)
 .Cells(13, 19) = Sheets("印刷").Cells(11, 31)
 .Cells(13, 12) = Sheets("印刷").Cells(11, 32)
 .Cells(13, 13) = Sheets("印刷").Cells(11, 33)
 .Cells(13, 15) = Sheets("印刷").Cells(11, 34)
 .Cells(13, 8) = Sheets("印刷").Cells(11, 36)
 .Cells(14, 8) = Sheets("印刷").Cells(11, 38)
 .Cells(13, 9) = Sheets("印刷").Cells(11, 39)
 .Cells(14, 9) = Sheets("印刷").Cells(11, 41)
 .Cells(13, 10) = Sheets("印刷").Cells(11, 42)

 '7行
 .Cells(15, 6) = Sheets("印刷").Cells(12, 2)
 .Cells(15, 7) = Sheets("印刷").Cells(12, 3)
 .Cells(15, 2) = Sheets("印刷").Cells(12, 14)
 .Cells(15, 11) = Sheets("印刷").Cells(12, 26)
 .Cells(15, 16) = Sheets("印刷").Cells(12, 29)
 .Cells(15, 17) = Sheets("印刷").Cells(12, 30)
 .Cells(15, 19) = Sheets("印刷").Cells(12, 31)
 .Cells(15, 12) = Sheets("印刷").Cells(12, 32)
 .Cells(15, 13) = Sheets("印刷").Cells(12, 33)
 .Cells(15, 15) = Sheets("印刷").Cells(12, 34)
 .Cells(15, 8) = Sheets("印刷").Cells(12, 36)
 .Cells(16, 8) = Sheets("印刷").Cells(12, 38)
 .Cells(15, 9) = Sheets("印刷").Cells(12, 39)
 .Cells(16, 9) = Sheets("印刷").Cells(12, 41)
 .Cells(15, 10) = Sheets("印刷").Cells(12, 42)
 
 '8行
 .Cells(17, 6) = Sheets("印刷").Cells(13, 2)
 .Cells(17, 7) = Sheets("印刷").Cells(13, 3)
 .Cells(17, 2) = Sheets("印刷").Cells(13, 14)
 .Cells(17, 11) = Sheets("印刷").Cells(13, 26)
 .Cells(17, 16) = Sheets("印刷").Cells(13, 29)
 .Cells(17, 17) = Sheets("印刷").Cells(13, 30)
 .Cells(17, 19) = Sheets("印刷").Cells(13, 31)
 .Cells(17, 12) = Sheets("印刷").Cells(13, 32)
 .Cells(17, 13) = Sheets("印刷").Cells(13, 33)
 .Cells(17, 15) = Sheets("印刷").Cells(13, 34)
 .Cells(17, 8) = Sheets("印刷").Cells(13, 36)
 .Cells(18, 8) = Sheets("印刷").Cells(13, 38)
 .Cells(17, 9) = Sheets("印刷").Cells(13, 39)
 .Cells(18, 9) = Sheets("印刷").Cells(13, 41)
 .Cells(17, 10) = Sheets("印刷").Cells(13, 42)

 '9行
 .Cells(19, 6) = Sheets("印刷").Cells(14, 2)
 .Cells(19, 7) = Sheets("印刷").Cells(14, 3)
 .Cells(19, 2) = Sheets("印刷").Cells(14, 14)
 .Cells(19, 11) = Sheets("印刷").Cells(14, 26)
 .Cells(19, 16) = Sheets("印刷").Cells(14, 29)
 .Cells(19, 17) = Sheets("印刷").Cells(14, 30)
 .Cells(19, 19) = Sheets("印刷").Cells(14, 31)
 .Cells(19, 12) = Sheets("印刷").Cells(14, 32)
 .Cells(19, 13) = Sheets("印刷").Cells(14, 33)
 .Cells(19, 15) = Sheets("印刷").Cells(14, 34)
 .Cells(19, 8) = Sheets("印刷").Cells(14, 36)
 .Cells(20, 8) = Sheets("印刷").Cells(14, 38)
 .Cells(19, 9) = Sheets("印刷").Cells(14, 39)
 .Cells(20, 9) = Sheets("印刷").Cells(14, 41)
 .Cells(19, 10) = Sheets("印刷").Cells(14, 42)

 '10行
 .Cells(21, 6) = Sheets("印刷").Cells(15, 2)
 .Cells(21, 7) = Sheets("印刷").Cells(15, 3)
 .Cells(21, 2) = Sheets("印刷").Cells(15, 14)
 .Cells(21, 11) = Sheets("印刷").Cells(15, 26)
 .Cells(21, 16) = Sheets("印刷").Cells(15, 29)
 .Cells(21, 17) = Sheets("印刷").Cells(15, 30)
 .Cells(21, 19) = Sheets("印刷").Cells(15, 31)
 .Cells(21, 12) = Sheets("印刷").Cells(15, 32)
 .Cells(21, 13) = Sheets("印刷").Cells(15, 33)
 .Cells(21, 15) = Sheets("印刷").Cells(15, 34)
 .Cells(21, 8) = Sheets("印刷").Cells(15, 36)
 .Cells(22, 8) = Sheets("印刷").Cells(15, 38)
 .Cells(21, 9) = Sheets("印刷").Cells(15, 39)
 .Cells(22, 9) = Sheets("印刷").Cells(15, 41)
 .Cells(21, 10) = Sheets("印刷").Cells(15, 42)

End With

0 hits

【54553】マクロを短くしたい わんわん 08/3/18(火) 23:40 質問
【54554】Re:マクロを短くしたい かみちゃん 08/3/19(水) 0:08 発言
【54556】Re:マクロを短くしたい わんわん 08/3/19(水) 0:58 お礼
【54555】Re:マクロを短くしたい おちゃら 08/3/19(水) 0:26 発言
【54557】Re:マクロを短くしたい わんわん 08/3/19(水) 1:14 質問
【54558】Re:マクロを短くしたい かみちゃん 08/3/19(水) 1:44 発言
【54573】Re:マクロを短くしたい わんわん 08/3/20(木) 0:20 お礼
【54576】Re:マクロを短くしたい VBWASURETA 08/3/21(金) 12:36 発言
【54584】Re:マクロを短くしたい わんわん 08/3/22(土) 0:55 お礼
【54592】Re:マクロを短くしたい VBWASURETA 08/3/22(土) 18:15 発言
【54596】Re:マクロを短くしたい わんわん 08/3/22(土) 20:57 質問
【54598】Re:マクロを短くしたい neptune 08/3/22(土) 21:20 発言
【54599】Re:マクロを短くしたい わんわん 08/3/23(日) 1:42 お礼
【54602】Re:マクロを短くしたい neptune 08/3/23(日) 15:21 回答
【54605】Re:マクロを短くしたい わんわん 08/3/23(日) 23:36 お礼
【54609】Re:マクロを短くしたい VBWASURETA 08/3/24(月) 9:55 発言
【54678】Re:マクロを短くしたい わんわん 08/3/25(火) 23:45 お礼

27498 / 76732 ←次へ | 前へ→
ページ:  ┃  記事番号:
2610219
(SS)C-BOARD v3.8 is Free