View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default From Column to Row without blank cells

Sub movetorows()

Rows(1).Insert 'Insert blank row to simplifiy coding

StartColumn = 5 'Start putting data into column E
NewColumn = StartColumn
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For RowCount = 2 To LastRow
If Range("A" & RowCount) < "" Then
NewName = Range("A" & RowCount)
Score = Range("C" & RowCount)
Set c = Rows(1).Find(what:=NewName, _
LookIn:=xlValues)
If Not c Is Nothing Then
Set NewCell = c.End(xlDown).Offset(1, 0)
NewCell.Value = Score
Else
Cells(1, NewColumn) = NewName
Cells(2, NewColumn) = Score
NewColumn = NewColumn + 1
End If
End If
Next RowCount

End Sub

"REVILO" wrote:

I have 3 columns of data 1st being names then date and time and finally event
scores, I want to move the names colunm to rows but only taking one instance,
then leave the date and time in column format. Now I need to fill each row
with the score relivent without having a blank cell. I have tried using IF
statments but after the first cell has been used it moves over 1 cell and
down 1 cell to put the next event score. Please can you help.