I have this macro but it seems like there must be a shorter way to do this. I have to write it for "If Cells(X, 161).Value = 1,2,3,4,5,6,7,8,9,10". Note (in the example below) as the if value increases by 1 on the left, the cell values increase by 1 as well on the right.
Sub Moan()
finalrow = Cells(Rows.Count, 160).End(xlUp).Row
For X = 4 To finalrow
If Cells(X, 161).Value = 1 Then Cells(X, 162).Value = Cells(X, 6).Value
If Cells(X, 161).Value = 1 Then Cells(X, 163).Value = Cells(X, 17).Value
If Cells(X, 161).Value = 1 Then Cells(X, 164).Value = Cells(X, 50).Value
If Cells(X, 161).Value = 1 Then Cells(X, 165).Value = Cells(X, 61).Value
If Cells(X, 161).Value = 1 Then Cells(X, 166).Value = Cells(X, 72).Value
If Cells(X, 161).Value = 1 Then Cells(X, 167).Value = Cells(X, 83).Value
If Cells(X, 161).Value = 2 Then Cells(X, 162).Value = Cells(X, 7).Value
If Cells(X, 161).Value = 2 Then Cells(X, 163).Value = Cells(X, 18).Value
If Cells(X, 161).Value = 2 Then Cells(X, 164).Value = Cells(X, 51).Value
If Cells(X, 161).Value = 2 Then Cells(X, 165).Value = Cells(X, 62).Value
If Cells(X, 161).Value = 2 Then Cells(X, 166).Value = Cells(X, 73).Value
If Cells(X, 161).Value = 2 Then Cells(X, 167).Value = Cells(X, 84).Value
Next X
End Sub
Bookmarks