View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
KRCowen KRCowen is offline
external usenet poster
 
Posts: 21
Default Auto-Replacing Blank Fields

If you want to do what I think you want to do, you can select the column that
you want to populate and run the following code. You can either run it for
each column or modify it to handle multiple columns.

Sub test()

For i = 1 To Selection.Rows.Count
If Cells(ActiveCell.Row, ActiveCell.Column).Offset(1, 0) = "" Then
ActiveCell.Offset(1, 0).Value = ActiveCell.Value
ActiveCell.Offset(1, 0).Activate
Else
ActiveCell.Offset(1, 0).Activate
End If
Next i

End Sub

I have assumed that all the test scores for a student are in consecutive rows.
If that is not the case then I am not sure how you can tell what scores go with
what student. If a student appears with several blocks of rows, you can run
this code, then sort by the name to get all of a students stuff together.

I hope this helps.

Ken
Norfolk, Va