Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Cell link via macro?

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....

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Cell link via macro?

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....

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Cell link via macro?

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....

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Cell link via macro?

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use Cell Link in Macro? dfrost57 Excel Programming 0 May 15th 07 03:28 AM
How do I use Cell Link in Macro? dfrost57 Excel Programming 0 May 15th 07 03:28 AM
I want to link a cell in the macro [email protected] Excel Discussion (Misc queries) 1 April 9th 07 06:30 AM
Link cell contents to a Macro? Dave Excel Programming 6 August 28th 06 09:36 PM
Link a macro to a cell value Rich[_20_] Excel Programming 4 November 5th 03 06:35 PM


All times are GMT +1. The time now is 11:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"