Autofill data in a worksheet

L

Laptopguy

I have a text file that has data in it like this:
test1 math
john score 0 0 0 0
test2 english
mary scrore 10 15 20 30
test3 history
simon score 23 17 21 30
test4 trig
peter score 15 17 22 21

I would like to write a function that will align the test with the scores so
it does not show on two lines. I would appreciate any assistance I can get.
 
D

Don Guillett

try this
Sub alignrows()
mc = "a"
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -2
'MsgBox Cells(i, mc)
Cells(i - 1, mc) = Cells(i - 1, mc) & " " & Cells(i, mc)
Rows(i).Delete
Next i
End Sub
 

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