Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Try again - adress from a range to combobox

Hi

if u have arange maybe
$B$31:$B$43
And i have the values from this range in a combobox
how do i get det address from the range when i select a value in my
combo box.
Let us say that $B$31:$B$43 is numbers and in $B$40 are there maby number 8
i select number 8 in my combobox and the I want to use the address where
number 8 are, in this case $B$40

Hope someone can help

Alvin


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Try again - adress from a range to combobox

Hi again,
A simple Userform with a combobox and textbox. The combobox
is filled with data from named range "MyRange": selection form the combobox
puts the address of the element of "MyRange" in the textbox.

HTH

Private Sub ComboBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim rng As Range
Set rng = Range("Myrange")
n = CInt(ComboBox1.Value)
TextBox1.Value = rng(n).Address
End Sub


Private Sub UserForm_Initialize()
' "MyRange" is , for example, "A11:A20" with values 1 to 10
ComboBox1.RowSource = "MyRange"
End Sub

"alvin Kuiper" wrote:

Hi

if u have arange maybe
$B$31:$B$43
And i have the values from this range in a combobox
how do i get det address from the range when i select a value in my
combo box.
Let us say that $B$31:$B$43 is numbers and in $B$40 are there maby number 8
i select number 8 in my combobox and the I want to use the address where
number 8 are, in this case $B$40

Hope someone can help

Alvin


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Try again - adress from a range to combobox

Thanks Toppers
you are the best
many many thanks

Alvin


"Toppers" wrote:

Hi again,
A simple Userform with a combobox and textbox. The combobox
is filled with data from named range "MyRange": selection form the combobox
puts the address of the element of "MyRange" in the textbox.

HTH

Private Sub ComboBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim rng As Range
Set rng = Range("Myrange")
n = CInt(ComboBox1.Value)
TextBox1.Value = rng(n).Address
End Sub


Private Sub UserForm_Initialize()
' "MyRange" is , for example, "A11:A20" with values 1 to 10
ComboBox1.RowSource = "MyRange"
End Sub

"alvin Kuiper" wrote:

Hi

if u have arange maybe
$B$31:$B$43
And i have the values from this range in a combobox
how do i get det address from the range when i select a value in my
combo box.
Let us say that $B$31:$B$43 is numbers and in $B$40 are there maby number 8
i select number 8 in my combobox and the I want to use the address where
number 8 are, in this case $B$40

Hope someone can help

Alvin


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Try again - adress from a range to combobox

Private Sub Combobox1_Click()
msgbox "B" & 31 + Userform.Combobox1.ListIndex
End Sub

--
Regards,
Tom Ogilvy


"alvin Kuiper" wrote in message
...
Hi

if u have arange maybe
$B$31:$B$43
And i have the values from this range in a combobox
how do i get det address from the range when i select a value in my
combo box.
Let us say that $B$31:$B$43 is numbers and in $B$40 are there maby number

8
i select number 8 in my combobox and the I want to use the address where
number 8 are, in this case $B$40

Hope someone can help

Alvin




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
Return cell adress for next non-blank cell in a range toreadore Excel Worksheet Functions 1 June 28th 06 12:37 PM
ComboBox Range ca1358 Excel Programming 2 January 9th 06 08:48 PM
Show one range in a combobox and write the 2nd range! Kevin Excel Programming 1 October 17th 03 05:52 AM
ComboBox.Value To Range Hamilton R. Romano Excel Programming 0 September 9th 03 05:28 PM
Adress of Copied Range Luis Carrion Excel Programming 1 August 14th 03 04:05 AM


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

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

About Us

"It's about Microsoft Excel"