Hello, Im looking for a way to create a dropdown in an excel spreadsheet using vb.net - Ive created spreadsheets and assigned values to cells, but never made a dropdown, and Im not having much luck finding any info online. Thanks!
I like Donnachas idea to pre-make the drop-downs. If you really need to make them on the Worksheet dynamically, then the best way to learn this kind of command is to use the Macro Recorder in VBA. You access it from within Excel using Alt|Tools|Macros|RecordMacros... Then do whatever you need to, stop the recorder, and then hit Alt+F11 to see your code within the VBA-IDE.
There are also two types of DropDowns: (1) from the Forms toolbar and from (2) the Controls Toolbox toolbar. Using the Macro Recorder, I got the following for the Forms toolbar version:
Hopefully this should translate through the COM Interop, but I think it should. Although, if you are using Option Strict On (which is recommended) you will need to add some DirectCast() calls...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.