PC Review


Reply
Thread Tools Rate Thread

Define the Range of a drop-down list

 
 
BrucenAZ
Guest
Posts: n/a
 
      25th Nov 2008
I'm a bit confused about cell assignment of drop-down lists.

My drop-down list refers to an input range and cell link on a second
worksheet in the same workbook. For example, the Input Range is:
Sheet2!$A$2:$A$6 and the Cell link is: Sheet2!$A$8. I'm trying to create a
macro that will reset the drop- down list to a default ""Choose answer" item
in the list. For me, "Choose answer" is located in Sheet2!$A$2. The
drop-down list is located in Sheet1.

Does anyone know how to define the Range of a drop-down list in Excel?

Thanks,
Bruce

 
Reply With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      25th Nov 2008
Hi Bruce

try this:

Me.ComboBox1.ListIndex = 0

Regards,
Per

"BrucenAZ" <(E-Mail Removed)> skrev i meddelelsen
news:59E9C56F-E7F7-419D-8425-(E-Mail Removed)...
> I'm a bit confused about cell assignment of drop-down lists.
>
> My drop-down list refers to an input range and cell link on a second
> worksheet in the same workbook. For example, the Input Range is:
> Sheet2!$A$2:$A$6 and the Cell link is: Sheet2!$A$8. I'm trying to create
> a
> macro that will reset the drop- down list to a default ""Choose answer"
> item
> in the list. For me, "Choose answer" is located in Sheet2!$A$2. The
> drop-down list is located in Sheet1.
>
> Does anyone know how to define the Range of a drop-down list in Excel?
>
> Thanks,
> Bruce
>


 
Reply With Quote
 
BrucenAZ
Guest
Posts: n/a
 
      25th Nov 2008
Perhaps I wasn't clear about my skill level: I know enough to get me in
trouble.
Per my post, this is what I've come up with. It does not work.

Range("Sheet2!$A$8").Select
ActiveCell = "Choose answer"

I do not know the Me command. I tried replacing my statements (above) with
your suggestion. I got a complie error; "Invalid use of Me keyword." Maybe
I'm not using it correctly?

Thanks,
Bruce

"Per Jessen" wrote:

> Hi Bruce
>
> try this:
>
> Me.ComboBox1.ListIndex = 0
>
> Regards,
> Per
>
> "BrucenAZ" <(E-Mail Removed)> skrev i meddelelsen
> news:59E9C56F-E7F7-419D-8425-(E-Mail Removed)...
> > I'm a bit confused about cell assignment of drop-down lists.
> >
> > My drop-down list refers to an input range and cell link on a second
> > worksheet in the same workbook. For example, the Input Range is:
> > Sheet2!$A$2:$A$6 and the Cell link is: Sheet2!$A$8. I'm trying to create
> > a
> > macro that will reset the drop- down list to a default ""Choose answer"
> > item
> > in the list. For me, "Choose answer" is located in Sheet2!$A$2. The
> > drop-down list is located in Sheet1.
> >
> > Does anyone know how to define the Range of a drop-down list in Excel?
> >
> > Thanks,
> > Bruce
> >

>
>

 
Reply With Quote
 
Per Jessen
Guest
Posts: n/a
 
      25th Nov 2008
Bruce,

The ME keyword is refering to the active object in this case the active
sheet, so it can only be used if your code is placed on the code sheet for
sheet1.

But if we shall follow your road, this is what you need:

Sheets("Sheet2").Range("A8").Value = "Choose answer")

Regards,
Per

"BrucenAZ" <(E-Mail Removed)> skrev i meddelelsen
news:C05E1346-A820-49D2-8912-(E-Mail Removed)...
> Perhaps I wasn't clear about my skill level: I know enough to get me in
> trouble.
> Per my post, this is what I've come up with. It does not work.
>
> Range("Sheet2!$A$8").Select
> ActiveCell = "Choose answer"
>
> I do not know the Me command. I tried replacing my statements (above)
> with
> your suggestion. I got a complie error; "Invalid use of Me keyword."
> Maybe
> I'm not using it correctly?
>
> Thanks,
> Bruce
>
> "Per Jessen" wrote:
>
>> Hi Bruce
>>
>> try this:
>>
>> Me.ComboBox1.ListIndex = 0
>>
>> Regards,
>> Per
>>
>> "BrucenAZ" <(E-Mail Removed)> skrev i meddelelsen
>> news:59E9C56F-E7F7-419D-8425-(E-Mail Removed)...
>> > I'm a bit confused about cell assignment of drop-down lists.
>> >
>> > My drop-down list refers to an input range and cell link on a second
>> > worksheet in the same workbook. For example, the Input Range is:
>> > Sheet2!$A$2:$A$6 and the Cell link is: Sheet2!$A$8. I'm trying to
>> > create
>> > a
>> > macro that will reset the drop- down list to a default ""Choose answer"
>> > item
>> > in the list. For me, "Choose answer" is located in Sheet2!$A$2. The
>> > drop-down list is located in Sheet1.
>> >
>> > Does anyone know how to define the Range of a drop-down list in Excel?
>> >
>> > Thanks,
>> > Bruce
>> >

>>
>>


 
Reply With Quote
 
BrucenAZ
Guest
Posts: n/a
 
      25th Nov 2008
Very close now! Macro works when in Visual Basic mode using:

Sheets("Sheet2").Range("A8").Value = Sheets("Sheet2").Range("A2").Select

Range A2 is obviously my "Choose Answer" selection in the drop-down list.

However, when I click the button in the app to activate the macro, I get
Run-time error 1004; Unable to get the Select property of the Range class.

Any thoughts? You've been a great help - thanks!

Bruce



"Per Jessen" wrote:

> Bruce,
>
> The ME keyword is refering to the active object in this case the active
> sheet, so it can only be used if your code is placed on the code sheet for
> sheet1.
>
> But if we shall follow your road, this is what you need:
>
> Sheets("Sheet2").Range("A8").Value = "Choose answer")
>
> Regards,
> Per
>
> "BrucenAZ" <(E-Mail Removed)> skrev i meddelelsen
> news:C05E1346-A820-49D2-8912-(E-Mail Removed)...
> > Perhaps I wasn't clear about my skill level: I know enough to get me in
> > trouble.
> > Per my post, this is what I've come up with. It does not work.
> >
> > Range("Sheet2!$A$8").Select
> > ActiveCell = "Choose answer"
> >
> > I do not know the Me command. I tried replacing my statements (above)
> > with
> > your suggestion. I got a complie error; "Invalid use of Me keyword."
> > Maybe
> > I'm not using it correctly?
> >
> > Thanks,
> > Bruce
> >
> > "Per Jessen" wrote:
> >
> >> Hi Bruce
> >>
> >> try this:
> >>
> >> Me.ComboBox1.ListIndex = 0
> >>
> >> Regards,
> >> Per
> >>
> >> "BrucenAZ" <(E-Mail Removed)> skrev i meddelelsen
> >> news:59E9C56F-E7F7-419D-8425-(E-Mail Removed)...
> >> > I'm a bit confused about cell assignment of drop-down lists.
> >> >
> >> > My drop-down list refers to an input range and cell link on a second
> >> > worksheet in the same workbook. For example, the Input Range is:
> >> > Sheet2!$A$2:$A$6 and the Cell link is: Sheet2!$A$8. I'm trying to
> >> > create
> >> > a
> >> > macro that will reset the drop- down list to a default ""Choose answer"
> >> > item
> >> > in the list. For me, "Choose answer" is located in Sheet2!$A$2. The
> >> > drop-down list is located in Sheet1.
> >> >
> >> > Does anyone know how to define the Range of a drop-down list in Excel?
> >> >
> >> > Thanks,
> >> > Bruce
> >> >
> >>
> >>

>
>

 
Reply With Quote
 
Per Jessen
Guest
Posts: n/a
 
      26th Nov 2008
Hi Bruce

Thanks for your reply.

With Combobox1 on sheet1: LinkedCell = Sheet2!A2, ListFillRange =
Sheet2!A2:A6
CommandButton1 on sheet1, and the code below:

Private Sub CommandButton1_Click()
Sheets("Sheet2").Range("A8").Value = "Choose answer"
End Sub

When I press the button, the combobox i reset to "Choose answer"

Hopes it helps.

Regards,
Per

"BrucenAZ" <(E-Mail Removed)> skrev i meddelelsen
news:73CD9A13-2590-4573-BE63-(E-Mail Removed)...
> Very close now! Macro works when in Visual Basic mode using:
>
> Sheets("Sheet2").Range("A8").Value = Sheets("Sheet2").Range("A2").Select
>
> Range A2 is obviously my "Choose Answer" selection in the drop-down list.
>
> However, when I click the button in the app to activate the macro, I get
> Run-time error 1004; Unable to get the Select property of the Range class.
>
> Any thoughts? You've been a great help - thanks!
>
> Bruce
>
>
>
> "Per Jessen" wrote:
>
>> Bruce,
>>
>> The ME keyword is refering to the active object in this case the active
>> sheet, so it can only be used if your code is placed on the code sheet
>> for
>> sheet1.
>>
>> But if we shall follow your road, this is what you need:
>>
>> Sheets("Sheet2").Range("A8").Value = "Choose answer")
>>
>> Regards,
>> Per
>>
>> "BrucenAZ" <(E-Mail Removed)> skrev i meddelelsen
>> news:C05E1346-A820-49D2-8912-(E-Mail Removed)...
>> > Perhaps I wasn't clear about my skill level: I know enough to get me in
>> > trouble.
>> > Per my post, this is what I've come up with. It does not work.
>> >
>> > Range("Sheet2!$A$8").Select
>> > ActiveCell = "Choose answer"
>> >
>> > I do not know the Me command. I tried replacing my statements (above)
>> > with
>> > your suggestion. I got a complie error; "Invalid use of Me keyword."
>> > Maybe
>> > I'm not using it correctly?
>> >
>> > Thanks,
>> > Bruce
>> >
>> > "Per Jessen" wrote:
>> >
>> >> Hi Bruce
>> >>
>> >> try this:
>> >>
>> >> Me.ComboBox1.ListIndex = 0
>> >>
>> >> Regards,
>> >> Per
>> >>
>> >> "BrucenAZ" <(E-Mail Removed)> skrev i meddelelsen
>> >> news:59E9C56F-E7F7-419D-8425-(E-Mail Removed)...
>> >> > I'm a bit confused about cell assignment of drop-down lists.
>> >> >
>> >> > My drop-down list refers to an input range and cell link on a second
>> >> > worksheet in the same workbook. For example, the Input Range is:
>> >> > Sheet2!$A$2:$A$6 and the Cell link is: Sheet2!$A$8. I'm trying to
>> >> > create
>> >> > a
>> >> > macro that will reset the drop- down list to a default ""Choose
>> >> > answer"
>> >> > item
>> >> > in the list. For me, "Choose answer" is located in Sheet2!$A$2.
>> >> > The
>> >> > drop-down list is located in Sheet1.
>> >> >
>> >> > Does anyone know how to define the Range of a drop-down list in
>> >> > Excel?
>> >> >
>> >> > Thanks,
>> >> > Bruce
>> >> >
>> >>
>> >>

>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: drop-down List range define Don Guillett Microsoft Excel Misc 2 17th Dec 2006 07:26 PM
Re: drop-down List range define Gord Dibben Microsoft Excel Misc 0 17th Dec 2006 04:59 PM
Define a range containing the first 10 rows of a filtered list =?Utf-8?B?TWFyY28=?= Microsoft Excel Worksheet Functions 3 7th Oct 2005 01:42 PM
Define range for graphs/charts with validation list janfolmer Microsoft Excel Misc 2 29th Aug 2005 02:02 PM
how do i define a range as a list when there is no list option in. =?Utf-8?B?RG9tZXNwYWNpbw==?= Microsoft Excel Worksheet Functions 2 25th May 2005 11:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:59 PM.