Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
CAn i with this code also get the name of the cell Set myrange2 = Sheets(Range("kurt!$h$1").Value).Range(Range("kurt !$h$1").Value) For Each b In myrange2 kursist1.AddItem b.Text Next If i just can get the cell name also then it is perfect Regards alvin |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What do you mean by name? If you want its address, use
b.Address -- HTH RP (remove nothere from the email address if mailing direct) "Alvin Hansen" wrote in message ... Hi CAn i with this code also get the name of the cell Set myrange2 = Sheets(Range("kurt!$h$1").Value).Range(Range("kurt !$h$1").Value) For Each b In myrange2 kursist1.AddItem b.Text Next If i just can get the cell name also then it is perfect Regards alvin |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks bob
yes its was the address but how can i get this adress in my combobox just now i have this Range("kursist!$g$1").Value = kursist1.Text but i also want the address into another cell can i do that? Like if i make my choise in the combobox i get value kursist.text into one cell and the address into another cell Reagrds Alvin "Bob Phillips" skrev: What do you mean by name? If you want its address, use b.Address -- HTH RP (remove nothere from the email address if mailing direct) "Alvin Hansen" wrote in message ... Hi CAn i with this code also get the name of the cell Set myrange2 = Sheets(Range("kurt!$h$1").Value).Range(Range("kurt !$h$1").Value) For Each b In myrange2 kursist1.AddItem b.Text Next If i just can get the cell name also then it is perfect Regards alvin |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not really sure that I understand, but if your combobox is filled from a
worksheet range, when an item is selected from the combox, ListIndex returns the index, so you could use that to build the address. -- HTH RP (remove nothere from the email address if mailing direct) "Alvin Hansen" wrote in message ... Thanks bob yes its was the address but how can i get this adress in my combobox just now i have this Range("kursist!$g$1").Value = kursist1.Text but i also want the address into another cell can i do that? Like if i make my choise in the combobox i get value kursist.text into one cell and the address into another cell Reagrds Alvin "Bob Phillips" skrev: What do you mean by name? If you want its address, use b.Address -- HTH RP (remove nothere from the email address if mailing direct) "Alvin Hansen" wrote in message ... Hi CAn i with this code also get the name of the cell Set myrange2 = Sheets(Range("kurt!$h$1").Value).Range(Range("kurt !$h$1").Value) For Each b In myrange2 kursist1.AddItem b.Text Next If i just can get the cell name also then it is perfect Regards alvin |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks bob
I undrstand now then there are just one thing before i can use it i have a name range =Offset(kursister!$A$1;0;0;TÆLV(kursister!$A:$A); 1) The TÆLV is because it is a danish excel But hope you can understnd it anyway i ges yu know Offset. Now her it is instead of $A$1 then i want to have a cell value i try but get an error no matter what i do Hoope you can help Regards alvin "Bob Phillips" skrev: Not really sure that I understand, but if your combobox is filled from a worksheet range, when an item is selected from the combox, ListIndex returns the index, so you could use that to build the address. -- HTH RP (remove nothere from the email address if mailing direct) "Alvin Hansen" wrote in message ... Thanks bob yes its was the address but how can i get this adress in my combobox just now i have this Range("kursist!$g$1").Value = kursist1.Text but i also want the address into another cell can i do that? Like if i make my choise in the combobox i get value kursist.text into one cell and the address into another cell Reagrds Alvin "Bob Phillips" skrev: What do you mean by name? If you want its address, use b.Address -- HTH RP (remove nothere from the email address if mailing direct) "Alvin Hansen" wrote in message ... Hi CAn i with this code also get the name of the cell Set myrange2 = Sheets(Range("kurt!$h$1").Value).Range(Range("kurt !$h$1").Value) For Each b In myrange2 kursist1.AddItem b.Text Next If i just can get the cell name also then it is perfect Regards alvin |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Alvin,
Do you want to set the range name from VBA? If so, assuming the listindex value is in a variable idx say, you can do it with ActiveWorkbook.Names.Add name:="your_name", RefersTo:="=OFFSET(kursister!$A$" & idx & ",0,0,COUNTA(kursister!$A:$A),1)" Note that I use the English functions, because as I understand it in VBA all code is English, and Excel will automatically convert for you. -- HTH RP (remove nothere from the email address if mailing direct) "Alvin Hansen" wrote in message ... Thanks bob I undrstand now then there are just one thing before i can use it i have a name range =Offset(kursister!$A$1;0;0;TÆLV(kursister!$A:$A);1 ) The TÆLV is because it is a danish excel But hope you can understnd it anyway i ges yu know Offset. Now her it is instead of $A$1 then i want to have a cell value i try but get an error no matter what i do Hoope you can help Regards alvin "Bob Phillips" skrev: Not really sure that I understand, but if your combobox is filled from a worksheet range, when an item is selected from the combox, ListIndex returns the index, so you could use that to build the address. -- HTH RP (remove nothere from the email address if mailing direct) "Alvin Hansen" wrote in message ... Thanks bob yes its was the address but how can i get this adress in my combobox just now i have this Range("kursist!$g$1").Value = kursist1.Text but i also want the address into another cell can i do that? Like if i make my choise in the combobox i get value kursist.text into one cell and the address into another cell Reagrds Alvin "Bob Phillips" skrev: What do you mean by name? If you want its address, use b.Address -- HTH RP (remove nothere from the email address if mailing direct) "Alvin Hansen" wrote in message ... Hi CAn i with this code also get the name of the cell Set myrange2 = Sheets(Range("kurt!$h$1").Value).Range(Range("kurt !$h$1").Value) For Each b In myrange2 kursist1.AddItem b.Text Next If i just can get the cell name also then it is perfect Regards alvin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing | Excel Discussion (Misc queries) | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Worksheet Functions | |||
How to create/run "cell A equals Cell B put Cell C info in Cell D | Excel Discussion (Misc queries) | |||
data validation to restrict input in cell based on value of cell above that cell | Excel Programming |