Auto fill cells

C

Cheffred

I am dumping a file from another program. In one of the columns, the account
#, only the first cell in each group is filled in. Is there a way to
automatically go through and fill the other cells in each group with the
account number? I could manualy copy and paste each group, but the report is
12,000 lines. I don't have that much time and my interns have left for the
day.

I appreciate the help
 
R

ryguy7272

Those interns must have sensed something was up and gotten out of there!!

Notice, this works on ColumnA; change to suit:
Sub FillIn()
Dim lastrow As Long
lastrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Range("A2:A" & lastrow).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"
End Sub

Also:
http://www.contextures.com/xlDataEntry02.html

BTW, don't have people do things like this. That's what Excel is for. If
you can describe the logic, you can code it.

Regards,
Ryan---
 
G

Gord Dibben

You could do this without the use of VBA

Select the column with the blanks.

F5>Special>Blanks>OK

Type an = sign in active blank cell.

Point or arrow to cell above.

Hit CTRL + ENTER.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top