close

Hi
I am new to VBA. I want to create a dropdown list in Sheet1!A1 with data
from Sheet2!A1:A400. I have already filtered the data in Sheet2!. Is there
anyone who knows a short explanation or maybe just know a link for
VBA-beginners?
--
Therese

Therese
You don't need VBA for that. Simply name the range in Sheet2 and use
the name in the Data Validation in Sheet1.
Do this:
Select Sheet2.
Click in the name box (right above the quot;Aquot; of Column A) and type quot;A1:A400quot;
without the quotes.
Hit Enter
Now A1:A400 is selected.
Click on Insert - Name - Define.
Type in the range name you wish, any name, say MyRange.
Click OK.
Now go back to Sheet1 and click on the cell in which you want the Data
Validation.
Click on Data - Validation.
In the quot;Allow:quot; box, click on the down arrow and select List.
In the quot;Source:quot; box, type quot;MyRangequot; without the quotes.
Click OK.
Done
HTH Otto
quot;Theresequot; gt; wrote in message
...
gt; Hi
gt; I am new to VBA. I want to create a dropdown list in Sheet1!A1 with data
gt; from Sheet2!A1:A400. I have already filtered the data in Sheet2!. Is there
gt; anyone who knows a short explanation or maybe just know a link for
gt; VBA-beginners?
gt; --
gt; Therese
Hi Otto
Thanks a lot. There is just one little problem...when the button show, the
only word I can choos is quot;Produktquot; wich is what I called the list instead of
myrange. But thanks for explaning.

quot;Otto Moehrbachquot; skrev:

gt; Therese
gt; You don't need VBA for that. Simply name the range in Sheet2 and use
gt; the name in the Data Validation in Sheet1.
gt; Do this:
gt; Select Sheet2.
gt; Click in the name box (right above the quot;Aquot; of Column A) and type quot;A1:A400quot;
gt; without the quotes.
gt; Hit Enter
gt; Now A1:A400 is selected.
gt; Click on Insert - Name - Define.
gt; Type in the range name you wish, any name, say MyRange.
gt; Click OK.
gt; Now go back to Sheet1 and click on the cell in which you want the Data
gt; Validation.
gt; Click on Data - Validation.
gt; In the quot;Allow:quot; box, click on the down arrow and select List.
gt; In the quot;Source:quot; box, type quot;MyRangequot; without the quotes.
gt; Click OK.
gt; Done
gt; HTH Otto
gt; quot;Theresequot; gt; wrote in message
gt; ...
gt; gt; Hi
gt; gt; I am new to VBA. I want to create a dropdown list in Sheet1!A1 with data
gt; gt; from Sheet2!A1:A400. I have already filtered the data in Sheet2!. Is there
gt; gt; anyone who knows a short explanation or maybe just know a link for
gt; gt; VBA-beginners?
gt; gt; --
gt; gt; Therese
gt;
gt;
gt;

Hey thanks. But when I have done it, the only word I can choose is quot;produktquot;
which is what I called the list. What do you think I did wrong? I've done all
the rest.

quot;Otto Moehrbachquot; skrev:

gt; Therese
gt; You don't need VBA for that. Simply name the range in Sheet2 and use
gt; the name in the Data Validation in Sheet1.
gt; Do this:
gt; Select Sheet2.
gt; Click in the name box (right above the quot;Aquot; of Column A) and type quot;A1:A400quot;
gt; without the quotes.
gt; Hit Enter
gt; Now A1:A400 is selected.
gt; Click on Insert - Name - Define.
gt; Type in the range name you wish, any name, say MyRange.
gt; Click OK.
gt; Now go back to Sheet1 and click on the cell in which you want the Data
gt; Validation.
gt; Click on Data - Validation.
gt; In the quot;Allow:quot; box, click on the down arrow and select List.
gt; In the quot;Source:quot; box, type quot;MyRangequot; without the quotes.
gt; Click OK.
gt; Done
gt; HTH Otto
gt; quot;Theresequot; gt; wrote in message
gt; ...
gt; gt; Hi
gt; gt; I am new to VBA. I want to create a dropdown list in Sheet1!A1 with data
gt; gt; from Sheet2!A1:A400. I have already filtered the data in Sheet2!. Is there
gt; gt; anyone who knows a short explanation or maybe just know a link for
gt; gt; VBA-beginners?
gt; gt; --
gt; gt; Therese
gt;
gt;
gt;

=?Utf-8?B?IlQi?= wrote

gt; Hey thanks. But when I have done it, the only word I can choose is
gt; quot;produktquot; which is what I called the list. What do you think I did
gt; wrong? I've done all the rest.

Otto forgot to put an = in front of his Allow List example. In your case,
put =produkt there.

--
David

Wow...it worked. Excellent, I'm truly impressed!
Thanks and Merry X-mas :-)
--
Theresequot;Davidquot; skrev:

gt; =?Utf-8?B?IlQi?= wrote
gt;
gt; gt; Hey thanks. But when I have done it, the only word I can choose is
gt; gt; quot;produktquot; which is what I called the list. What do you think I did
gt; gt; wrong? I've done all the rest.
gt;
gt; Otto forgot to put an = in front of his Allow List example. In your case,
gt; put =produkt there.
gt;
gt; --
gt; David
gt;

David
You got me on that one. Thanks for correcting that. Otto
quot;Davidquot; gt; wrote in message
...
gt; =?Utf-8?B?IlQi?= wrote
gt;
gt;gt; Hey thanks. But when I have done it, the only word I can choose is
gt;gt; quot;produktquot; which is what I called the list. What do you think I did
gt;gt; wrong? I've done all the rest.
gt;
gt; Otto forgot to put an = in front of his Allow List example. In your case,
gt; put =produkt there.
gt;
gt; --
gt; David

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()