|    | 
     マクロの修正について教えてください!  
 
ある文書を作成するのに必要なマクロのシートがあります。 
抽出元(sheet1)の表を一部修正したため、sheet2に正しく抽出されず、修正しています。 
 
下記に詳細一部コピーしますが、これで抽出すると、同じデータが何度か繰り返し抽出され、重複してしまいます。 
 
マクロの知識が全くなく、修正しているので、お力貸していただけると幸いです。 
 
 
Application.ScreenUpdating = False 
'●●書 作成 
Sheets("テンプレート").Select 
Sheets("テンプレート").Copy After:=Sheets(1) 
ActiveSheet.Name = "●●書" 
 
Sheets("まとめ").Select 
OutPutRow = 19 
OutPutSheetCount = 1 
'D列で最終行を確認 
LastRow = Cells(1, 4).End(xlDown).Row 
 
For Row = 2 To LastRow 
datacount = Cells(Row, 27).Value 
For i = 1 To datacount 
If Cells(Row, 28 + (i - 1) * 7).Value <> "" Then 
'△データがあれば▲情報も出力 
1. = Cells(Row, 11).Value '代理店 
2. = Cells(Row, 26 + (i - 1) * 7).Value 'A 
3. = Cells(Row, 5).Value 'B 
4. = Cells(Row, 6).Value 'C 
5. = Cells(Row, 25 + (i - 1) * 7).Value 'D 
6. = Cells(Row, 18).Value 'E 
7. = Cells(Row, 4).Value 'F 
8. = Cells(Row, 10).Value 'G 
9. = Cells(Row, 27 + (i - 1) * 7).Value 'H 
10. = Cells(Row, 30 + (i - 1) * 7).Value 'I 
11. = Cells(Row, 31 + (i - 1) * 7).Value 'J 
End If 
Sheets("●●書").Select 
Cells(OutPutRow, 2).Value = 11. 
Cells(OutPutRow + 1, 2).Value = 1. 
Cells(OutPutRow, 3).Value = 2. 
Cells(OutPutRow + 1, 3).Value = 3. 
Cells(OutPutRow, 4).Value = 5. 
Cells(OutPutRow + 1, 4).Value = 4. 
Cells(OutPutRow + 1, 5).Value = 6. 
Cells(OutPutRow, 6).Value = 7. 
Cells(OutPutRow + 1, 6).Value = 8. 
Cells(OutPutRow + 1, 7).Value = 9. 
Cells(OutPutRow + 1, 8).Value = 10. 
OutPutRow = OutPutRow + 2 
 | 
     
    
   |