PC Review


Reply
Thread Tools Rate Thread

Cell link via macro?

 
 
Dori
Guest
Posts: n/a
 
      9th Apr 2008
Hi,
I´d like to get the value of item, selected in the list, but I have not
filled in the "Cell link". Have anyone any idea, how to get the value from
macro, without filling "Cell link"? I know the name of the element, but it
has no properties like Value or Text...
Thanks for any advice....

 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      9th Apr 2008
If it is a data validation list then just read the cell where the list is
located

MyValue = Range("A1")

"Dori" wrote:

> Hi,
> I´d like to get the value of item, selected in the list, but I have not
> filled in the "Cell link". Have anyone any idea, how to get the value from
> macro, without filling "Cell link"? I know the name of the element, but it
> has no properties like Value or Text...
> Thanks for any advice....
>

 
Reply With Quote
 
Dori
Guest
Posts: n/a
 
      10th Apr 2008
Thanks, but the list is not located in any cell. I have list (?drop down box)
which items are defined by cells range ("Input Range" in the format control).
Does anybody know?

Joel pÃ*Å¡e:

> If it is a data validation list then just read the cell where the list is
> located
>
> MyValue = Range("A1")
>
> "Dori" wrote:
>
> > Hi,
> > I´d like to get the value of item, selected in the list, but I have not
> > filled in the "Cell link". Have anyone any idea, how to get the value from
> > macro, without filling "Cell link"? I know the name of the element, but it
> > has no properties like Value or Text...
> > Thanks for any advice....
> >

 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      11th Apr 2008
This code should help. The LISTINDEX starts at 0 for first item in the list
box

Sub test()

ActiveSheet.ListBox1.Clear
ActiveSheet.ListBox1.AddItem "abc"
ActiveSheet.ListBox1.AddItem "def"
ActiveSheet.ListBox1.ListIndex = 1

SelectedItem = ActiveSheet.ListBox1.ListIndex


End Sub


"Dori" wrote:

> Thanks, but the list is not located in any cell. I have list (?drop down box)
> which items are defined by cells range ("Input Range" in the format control).
> Does anybody know?
>
> Joel pÃ*Å¡e:
>
> > If it is a data validation list then just read the cell where the list is
> > located
> >
> > MyValue = Range("A1")
> >
> > "Dori" wrote:
> >
> > > Hi,
> > > I´d like to get the value of item, selected in the list, but I have not
> > > filled in the "Cell link". Have anyone any idea, how to get the value from
> > > macro, without filling "Cell link"? I know the name of the element, but it
> > > has no properties like Value or Text...
> > > Thanks for any advice....
> > >

 
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
Macro to Paste Value and Link to Another Cell cardan Microsoft Excel Programming 2 29th May 2008 11:44 PM
How do I use Cell Link in Macro? =?Utf-8?B?ZGZyb3N0NTc=?= Microsoft Excel Programming 0 15th May 2007 03:28 AM
RE: How do I use Cell Link in Macro? =?Utf-8?B?ZGZyb3N0NTc=?= Microsoft Excel Programming 0 15th May 2007 03:28 AM
I want to link a cell in the macro karthi.nitk@gmail.com Microsoft Excel Misc 1 9th Apr 2007 06:30 AM
Link a macro to a cell value Rich Microsoft Excel Programming 4 5th Nov 2003 06:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:14 PM.