Required: to reference column values โโin a list.
There are n rows in one sheet, and each cell has a list that is referenced by the column values โโon another sheet. I created the following code, but it breaks after Z, because the ASCII values โโare not for AA, AB, ...
How to create a list for all rows using VBA?
Sub createList()
'creating custom list referencing cells from another sheet
Sheets("Checklist").Select
Dim i As Integer
For i = 1 To 100
Dim k As String
k = "='Parameter Options'!$" & Chr(64 + i) & "$1:$" & Chr(64 + i) & "$10"
'Parameter Options is the sheet i am taking list values from
Range("A" & i & ":C" & i).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=k
End With
Next i
End Sub
source
share