Howdy Trying to make dummies coding guide f but am struggling to code something up. In short I need to make a sheet to make a 7 digit code, I was planning to have 7 columns and when the user clicks the appropriate label in the column it generates a digit at the top, once they have done all 7 it will concatenate them into 1 long code. I would be great if I can have each selection highlight and but needs to be able to have selections change. Any experts able to direct me here Cheers
The below was set for a range of values in C3 to I9. It turns the selection green and puts a value in row 1, corresponding to the numerical position in the list. When 7 values are present you get a 7 digit number in K1. Code: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim irow As Integer Dim icol As Integer If Selection.Count = 1 Then If Not Intersect(Target, Range("C3:I9")) Is Nothing Then Let irow = ActiveCell.Row Let icol = ActiveCell.Column Cells(1, icol) = irow - 2 Range(Cells(3, icol), Cells(9, icol)).Interior.ColorIndex = 0 ActiveCell.Interior.ColorIndex = 4 If WorksheetFunction.CountA(Range("C1:I1")) = 7 Then Range("K1") = "=C1&D1&E1&F1&G1&H1&I1" Else Range("K1").ClearContents End If End If End If End Sub