VBA dynamic dropdownlist

mkh12ab

New Member
Joined
Apr 9, 2021
Messages
15
Office Version
  1. 2019
Platform
  1. Windows
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
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
ws3.Range("C1").Offset(1, ring).Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Formula1:="=" & dropdownTekst
 
Upvote 0
Solution

Forum statistics

Threads
1,213,565
Messages
6,114,338
Members
448,570
Latest member
rik81h

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top