A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Try this:
Sub ShuffleGrid()
Call ShuffleCol(Sheets("template").Range("C19:C29"))
Call ShuffleCol(Sheets("template").Range("F19:F29"))
Call ShuffleCol(Sheets("template").Range("I19:I29"))
Call ShuffleCol(Sheets("template").Range("L19:L29"))
Call ShuffleCol(Sheets("template").Range("O19:O29"))
End Sub
Sub ShuffleCol(rngSelected As Range)
Dim verticalLength As Long
Dim i As Long
Dim rndRow As Long
Dim temp As String
Dim tempColor As Long
Dim tempFontColor As Long
verticalLength = rngSelected.Rows.Count
For i = verticalLength To 1 Step -1
rndRow = Application.WorksheetFunction.RoundDown(verticalLength * Rnd + 1, 0)
temp = rngSelected.Cells(i, 1).Formula
tempColor = rngSelected.Cells(i, 1).Interior.Color
tempFontColor = rngSelected.Cells(i, 1).Font.Color
rngSelected.Cells(i, 1).Formula = rngSelected.Cells(rndRow, 1).Formula
rngSelected.Cells(i, 1).Interior.Color = rngSelected.Cells(rndRow, 1).Interior.Color
rngSelected.Cells(i, 1).Font.Color = rngSelected.Cells(rndRow, 1).Font.Color
rngSelected.Cells(rndRow, 1).Formula = temp
rngSelected.Cells(rndRow, 1).Interior.Color = tempColor
rngSelected.Cells(rndRow, 1).Font.Color = tempFontColor
Next i
End Sub