This macro is made to randomly draw specific number of civilization choices for a specific number of Civ V players. It is based on a list of 43 possibilities and the for loop in the while loop checks for already picked civilizations. Constant cell references point to values obtained with scroll-bars in the worksheet. The variable based cell references are made to structure the results in a two-column design.Are there any smart ways to make my code better from both an aesthetic as well as functional view?Sub CIV_draw()Range(K2:M50).ClearContentsDim x As Integerx = Cells(3, 3).ValueFor i = 1 To x    Cells(3 + (Cells(3, 7).Value + 2) * (i - 1), 11).Value = Player  & i    For j = 1 To Cells(3, 7).Value        Dim Rand_CIV As String        Dim RandNum As Integer        Dim checkVal As Boolean        checkVal = False        While checkVal = False            RandNum = CInt(Int(43 * Rnd())) + 1            Rand_CIV = Cells(RandNum, 16).Value &  ( & Cells(RandNum, 15).Value & )            For Z = 1 To 50                If Cells(Z, 12) = Rand_CIV Then                    Exit For                End If                If Z = 50 Then                    checkVal = True                End If            Next Z        Wend        Cells((Cells(3, 7).Value + 2) * (i - 1) + (j + 3), 12).Value = Rand_CIV    Next jNext iEnd SubI know for example that my duplicate check isn't optimal, and I would like to get suggestions for alternative solutions.
Randomizing Civilization 5 team choice
vba;excel