Thread: Repeat data
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Repeat data

Gary,
This assumes the data starts in row1:

Sub FillBlanks()
Dim v As Variant, i As Long
v = Range("A1:B" & ActiveSheet.UsedRange.Rows.Count)
For i = 2 To UBound(v)
If v(i, 1) = "" Then
If v(i, 2) < "" Then v(i, 1) = v(i - 1, 1)
End If
Next 'i
Range("A1:B" & ActiveSheet.UsedRange.Rows.Count) = v
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc