Hello all,
previously i have been getting alot of help with getting my dynamic dropdown range to work.
the special thing about this dropdown is that i create a dropdown in my VBA which can refers to deffirent columns.
the header will allways be written in row 2.
the data for the dropdown should be in the active column from row 3 and .End(xlDown)
issue at the moment is that my dropdown only show the data from my header (Row 2) which i have marked with red text
i believe that the range with yellow text is the answer to my troubles??
any help will be highly appriciated
so far it looks like
Set wb = ActiveWorkbook
Set ws1 = Ark3
Set ws2 = Ark2
Set ws3 = Ark4
' Create named range for validation list.
eRow = ws1.Cells(3, ring + 2).End(xlDown).Row
Set rnglist = ws1.Range(ws1.Cells(3, ring + 2), ws1.Cells(eRow, ring + 2))
wb.Names.Add Name:=dropdownTekst, RefersTo:=rnglist
'indsæt columns for Projekt reference
ws3.Visible = xlSheetVisible
ws3.Columns(ring + 3).Insert
ws3.Range("C1").Offset(0, ring) = dropdownTekst
ws3.Range("C1").Offset(1, ring).Validation.Delete
ws3.Range("C1").Offset(1, ring).Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Formula1:=dropdownTekst
ws3.Visible = xlSheetHidden
previously i have been getting alot of help with getting my dynamic dropdown range to work.
the special thing about this dropdown is that i create a dropdown in my VBA which can refers to deffirent columns.
the header will allways be written in row 2.
the data for the dropdown should be in the active column from row 3 and .End(xlDown)
issue at the moment is that my dropdown only show the data from my header (Row 2) which i have marked with red text
i believe that the range with yellow text is the answer to my troubles??
any help will be highly appriciated
so far it looks like
Set wb = ActiveWorkbook
Set ws1 = Ark3
Set ws2 = Ark2
Set ws3 = Ark4
' Create named range for validation list.
eRow = ws1.Cells(3, ring + 2).End(xlDown).Row
Set rnglist = ws1.Range(ws1.Cells(3, ring + 2), ws1.Cells(eRow, ring + 2))
wb.Names.Add Name:=dropdownTekst, RefersTo:=rnglist
'indsæt columns for Projekt reference
ws3.Visible = xlSheetVisible
ws3.Columns(ring + 3).Insert
ws3.Range("C1").Offset(0, ring) = dropdownTekst
ws3.Range("C1").Offset(1, ring).Validation.Delete
ws3.Range("C1").Offset(1, ring).Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Formula1:=dropdownTekst
ws3.Visible = xlSheetHidden