| 
    
     |  | Abeboboさん どうもありがとうございました。すごくわかりやすかったです、本当に感謝しています。今までプログラムを書いたりしたことがないので、本当苦労しています。どうも、お手数おかけしました。
 
 
 ▼Abebobo さん:
 >ちょっと見やすいようにまとめてみました。
 >
 >Sub ウィズでまとめて()
 >Dim lCnt As Long
 >Dim rCnt As Long
 >Dim i As Long
 >
 >lCnt = 1
 >rCnt = 30
 >With Sheets("Reuters")
 >
 >  .Range(.Cells(7, 1), .Cells(7, lCnt)).Select
 >  With Selection.Interior
 >   .ColorIndex = 20
 >   .Pattern = xlSolid
 >  End With
 >
 >  i = 8
 >  If .Range("C" & i).Text <> .Range("C7").Text Then
 >   .Range(.Cells(i, 1), .Cells(i, lCnt)).Select
 >   With Selection.Interior
 >     .ColorIndex = 15
 >     .Pattern = xlSolid
 >   End With
 >  Else
 >   .Range(.Cells(i, 1), .Cells(i, lCnt)).Select
 >   With Selection.Interior
 >     .ColorIndex = 20
 >     .Pattern = xlSolid
 >   End With
 >  End If
 >
 >  Do Until i > rCnt + 9
 >   If .Range("C" & i + 1).Text <> .Range("C" & i).Text Then
 >    .Range(.Cells(i + 1, 1), .Cells(i + 1, lCnt)).Select
 >    With Selection.Interior
 >      .ColorIndex = 20
 >      .Pattern = xlSolid
 >    End With
 >   Else
 >    .Range(.Cells(i + 1, 1), .Cells(i + 1, lCnt)).Select
 >    With Selection.Interior
 >      .ColorIndex = 15
 >      .Pattern = xlSolid
 >    End With
 >   End If
 >   i = i + 2
 >  Loop
 >  End With
 >
 >End Sub
 >
 >シートの構成がどうなってるか解らないので、
 >Do Until i > rCnt + 9
 >にしておきました。 i = i + 2 で i = rCnt + 9 だと ちょうど飛ばしちゃう可能性がありますから・・・。 あービックリした
 >
 >どううまくいかないのか? と コードにコメントを入れておいたほうが良いと思います。
 
 |  |