Create dropdown from dynamic list

Closed
Kasper - Oct 6, 2011 at 03:40 AM
 Blocked Profile - Oct 6, 2011 at 04:50 AM
Hello,

I'm trying to make a Macro that can make a dropdown list from a dynamic list in column A. So far I've come up with the following code:

Sub Test()

Range("A1", Range("A65536").End(xlUp)).Name = "MyList"

Cells(1, 3).Select

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="= & MyList"
.IgnoreBlank = False
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

End Sub

However calling MyList doesn't work. Am i doing it wrong or does somone have another way of calling the named range.

Regards,
Kasper

1 response

Blocked Profile
Oct 6, 2011 at 04:50 AM
Greetings,

Please, bare in mind that before any answer given on the forum, you should know that there are volunteers who give their time trying to solve user problems. They do have a life other than this forum including me.

Therefore, it is specifically requested from Kioskea forum users to show their respect. For this, the use of polite expressions is a minimum.
https://ccm.net/apps-sites/internet-archeology/ccm/10131-terms-of-use-for-ccm-respect-for-others/#politesse

To say please, thank you, appreciate, grateful, etc... is common courtesy when you want something, especially help!

You must copy, modify and repost your message respecting the politeness charter.

We trust that you understand.

Moderator
0