Thanks for the PM, my pleasure. Try this. I'm still not 100% sure if the interval is 20 or 20+1. If this code doesn't do the job it would be helpful if you could add to your attachment the expected results based on your example.
![]()
Sub x() Dim rng As Range, rStart As Range, nRow As Long, r As Long Sheet1.Activate Set rStart = Application.InputBox("Enter start cell", Type:=8) If rStart.Count > 1 Or rStart Is Nothing Then Exit Sub nRow = Application.InputBox("How many rows", Type:=1) If nRow = 0 Then Exit Sub Set rng = rStart.Resize(nRow, 5) Do Until IsEmpty(rStart) With Sheet2.Cells(Rows.Count, 1).End(xlUp)(2) .Value = rStart .Offset(, 1).Value = rStart.Offset(, 1) .Offset(, 2).Value = WorksheetFunction.Min(rng.Columns(3)) .Offset(, 3).Value = WorksheetFunction.Max(rng.Columns(4)) .Offset(, 4).Value = rStart.Offset(, 4) End With Set rng = rng.Offset(nRow) Set rStart = rStart.Offset(nRow) Loop End Sub











LinkBack URL
About LinkBacks
Register To Reply
Bookmarks