Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Display cell range in listbox

I managed to add and delete listbox entries on a sheet. However I need some
help to display that entries (range) in the listbox once I load a userform
again. Lastly, I would like some help for when I delete a specific entry in
the listbox to delete the corresponding cell value on the sheet.

Thanks!

Johann
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Display cell range in listbox

With worksheets("Sheet1")
Userform1.Listbox1.List =
..Range(.Cells(5,"F"),.Cells(5,"F").End(xldown)).V alue
End with


Dim rng as Range
idex = Userform.Listbox1.ListIndex
if idex = -1 then exit sub
With worksheets("Sheet1")
set rng = .Range(.Cells(5,"F"),.Cells(5,"F").End(xldown))(id ex)
end with

msgbox rng.Address


--
Regards,
Tom Ogilvy


"Johann" wrote in message
...
I managed to add and delete listbox entries on a sheet. However I need

some
help to display that entries (range) in the listbox once I load a userform
again. Lastly, I would like some help for when I delete a specific entry

in
the listbox to delete the corresponding cell value on the sheet.

Thanks!

Johann



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Display cell range in listbox

Thanks for your response Tom, this really helped a lot. I would however like
to simultaneously select the specific cell on the sheet when I select the
item in the list box. Currently the msgbox does the indication. Then lastly,
when I run your code, the listbox builds the item list at the bottom. I
presume it is running down the whole column.

Thx, Johann

"Tom Ogilvy" wrote:

With worksheets("Sheet1")
Userform1.Listbox1.List =
..Range(.Cells(5,"F"),.Cells(5,"F").End(xldown)).V alue
End with


Dim rng as Range
idex = Userform.Listbox1.ListIndex
if idex = -1 then exit sub
With worksheets("Sheet1")
set rng = .Range(.Cells(5,"F"),.Cells(5,"F").End(xldown))(id ex)
end with

msgbox rng.Address


--
Regards,
Tom Ogilvy


"Johann" wrote in message
...
I managed to add and delete listbox entries on a sheet. However I need

some
help to display that entries (range) in the listbox once I load a userform
again. Lastly, I would like some help for when I delete a specific entry

in
the listbox to delete the corresponding cell value on the sheet.

Thanks!

Johann




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Display cell range in listbox

msgbox was used to show you the results - it was there for illustration, not
for literal use. Obviously I have no idea what you are trying to achieve
beyond the technical question you asked.

Private Sub Listbox1_Click()
Dim rng as Range
idex = Userform.Listbox1.ListIndex
if idex = -1 then exit sub
With worksheets("Sheet1")
.Activate
set rng = .Range(.Cells(5,"F"),.Cells(5,"F").End(xldown))(id ex)
end with

rng.Select
End sub


I don't understand your "lastly" comments.

--
Regards,
Tom Ogilvy


"Johann" wrote in message
...
Thanks for your response Tom, this really helped a lot. I would however

like
to simultaneously select the specific cell on the sheet when I select the
item in the list box. Currently the msgbox does the indication. Then

lastly,
when I run your code, the listbox builds the item list at the bottom. I
presume it is running down the whole column.

Thx, Johann

"Tom Ogilvy" wrote:

With worksheets("Sheet1")
Userform1.Listbox1.List =
..Range(.Cells(5,"F"),.Cells(5,"F").End(xldown)).V alue
End with


Dim rng as Range
idex = Userform.Listbox1.ListIndex
if idex = -1 then exit sub
With worksheets("Sheet1")
set rng = .Range(.Cells(5,"F"),.Cells(5,"F").End(xldown))(id ex)
end with

msgbox rng.Address


--
Regards,
Tom Ogilvy


"Johann" wrote in message
...
I managed to add and delete listbox entries on a sheet. However I need

some
help to display that entries (range) in the listbox once I load a

userform
again. Lastly, I would like some help for when I delete a specific

entry
in
the listbox to delete the corresponding cell value on the sheet.

Thanks!

Johann






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Display cell range in listbox

I think you anticipated what I needed, as your example works just fine.
Thanks for your help and patience Tom.

"Tom Ogilvy" wrote:

msgbox was used to show you the results - it was there for illustration, not
for literal use. Obviously I have no idea what you are trying to achieve
beyond the technical question you asked.

Private Sub Listbox1_Click()
Dim rng as Range
idex = Userform.Listbox1.ListIndex
if idex = -1 then exit sub
With worksheets("Sheet1")
.Activate
set rng = .Range(.Cells(5,"F"),.Cells(5,"F").End(xldown))(id ex)
end with

rng.Select
End sub


I don't understand your "lastly" comments.

--
Regards,
Tom Ogilvy


"Johann" wrote in message
...
Thanks for your response Tom, this really helped a lot. I would however

like
to simultaneously select the specific cell on the sheet when I select the
item in the list box. Currently the msgbox does the indication. Then

lastly,
when I run your code, the listbox builds the item list at the bottom. I
presume it is running down the whole column.

Thx, Johann

"Tom Ogilvy" wrote:

With worksheets("Sheet1")
Userform1.Listbox1.List =
..Range(.Cells(5,"F"),.Cells(5,"F").End(xldown)).V alue
End with


Dim rng as Range
idex = Userform.Listbox1.ListIndex
if idex = -1 then exit sub
With worksheets("Sheet1")
set rng = .Range(.Cells(5,"F"),.Cells(5,"F").End(xldown))(id ex)
end with

msgbox rng.Address


--
Regards,
Tom Ogilvy


"Johann" wrote in message
...
I managed to add and delete listbox entries on a sheet. However I need
some
help to display that entries (range) in the listbox once I load a

userform
again. Lastly, I would like some help for when I delete a specific

entry
in
the listbox to delete the corresponding cell value on the sheet.

Thanks!

Johann






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
find last cell in range with data, display cell address sevi61 Excel Worksheet Functions 14 October 29th 07 08:36 PM
Display cell value in a range saman110 via OfficeKB.com Excel Discussion (Misc queries) 4 August 6th 07 11:21 PM
Display first cell in the right of range miro Excel Programming 2 March 20th 06 11:16 AM
ListBox display bug Ben Excel Programming 4 November 23rd 05 11:36 AM
Listbox Display Tom Ogilvy Excel Programming 0 April 1st 04 06:43 PM


All times are GMT +1. The time now is 09:51 AM.

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"