This is what I'm trying to get the data to look like. I am trying to match the values on the right with the top row of the values on the left. Sometimes there is only one row of information, and sometimes there are multiple rows. I've figured the below, which copies and moves to the correct location, but I cannot paste the values, also how would I get excel to loop through to continue the correct procedures? There are 20,000 lines of data in the sheet.
Option Explicit
Sub PA31_Macro()
ActiveCell.Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
If IsEmpty(ActiveCell) Then
ActiveCell.Offset(-1, 0).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Cut
ActiveCell.Offset(-2, -1).Select
If IsEmpty(ActiveCell) Then
ActiveCell.Offset(1, 1).PasteSpecial xlPasteValues
Else
ActiveCell.Offset(1, 0).Select
Selection.End(xlUp).Select
ActiveCell.Offset(0, 1).Select
ActiveCell.PasteSpecial xlPasteValues
End If
Else
ActiveCell.Offset(-1, 0).Select
ActiveCell.Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Cut
ActiveCell.Offset(-2, -1).Select
If IsEmpty(ActiveCell) Then
ActiveCell.Offset(1, 1).PasteSpecial xlPasteValues
Else
ActiveCell.Offset(1, 0).Select
Selection.End(xlUp).Select
ActiveCell.Offset(0, 1).Select
Range(ActiveCell).PasteSpecial xlPasteValues
End If
End If
End Sub
Data i am trying to edit