View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default find range and fill down

For the most part, my macro does exactly what your macro does; however, as
written, it copies down to the end of the UsedRange for the worksheet. The
following minor modification makes my macro duplicate the results of your
macro...

Sub FillInTheBlanks()
Dim Area As Range, LastRow As Long
On Error Resume Next
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
For Each Area In Intersect(Rows("25:" & LastRow), Range("C25"). _
Resize(LastRow).SpecialCells(xlCellTypeBlanks)).Ar eas
Area.Value = Area(1).Offset(-1).Value
Next
End Sub

Because it is handling empty Areas at a time, this should still be faster
than iterating each individual cell (unless there is no groupings of empty
cells, that is, unless each empty cell stands alone).

--
Rick (MVP - Excel)


"joel" wrote in message
...

Rick : Your code may not work in this situation. I think the person has
an ID in column a but no in every row so your code copies the same ID
down the entire worksheet. For example


Row Column A
1 Apple
2
3
4
5
6 Bananna
7
8
9
10
11 Pear
12
13
14
15 Grape


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=179831

Microsoft Office Help