There's a few ways to do this, perhaps easiest method is
this in a MODULE
- Code: Select all
Public Nextcol As Integer
and this in the SHEET
- Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Nextcol >= 200 Then
Nextcol = 0
End If
ThisWorkbook.Sheets(Target.Worksheet.Name).Range("y5:y14").Offset(0, Nextcol).Value = _
ThisWorkbook.Sheets(Target.Worksheet.Name).Range("o5:o14").Value
Nextcol = Nextcol + 1
Application.EnableEvents = True
End Sub
Nextcol will increment to 200 before resetting to 0, so that gives you column Y(0) to HQ(200) before resetting back to column Y