Filling in blank rows in a Table of data

  • Thread starter Thread starter Dave K
  • Start date Start date
D

Dave K

I have a table of data with the following layout

Flag Name Service
1 mike service 1
service 2
service 3
1 dave service 1
service 5
1 jeff service 7
service 5
service 4
1 eric service 1
service 9


I am wondering if there is a fomula that will allow me to fill in the
blanks (i.e., the missing names) in the name column. I would imagine
there is some variation of the counta function that I could apply in a
separate column (and then drag down) to produce the results i need.

All that i need is to fill in the blanks so that the table is
complete, and mike's name exists on the same record of each of his
services, and the same for jeff and eric.

Hope this makes sense. Any suggestions would be greatly appreciated.
 
Sub fillinblanks()
mc = 2 'Column B
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Cells(i, mc) = "" Then Cells(i, mc) = Cells(i - 1, mc)
Next i
End Sub
 
Thanks so much! It works great.

Sub fillinblanks()
mc = 2 'Column B
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Cells(i, mc) = "" Then Cells(i, mc) = Cells(i - 1, mc)
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software









- Show quoted text -
 
Back
Top