ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   select listbox item automatically (https://www.excelbanter.com/excel-programming/340021-select-listbox-item-automatically.html)

ilyaskazi[_71_]

select listbox item automatically
 

I hv 2 listboxes on userform..

If user is selecting the text of listbox1 then
get its index and select the text of listbox2(index of listbox1)
next also remove the selected item from both listboxes on clicking
remove btn.


--
ilyaskazi
------------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...o&userid=23969
View this thread: http://www.excelforum.com/showthread...hreadid=467414


Bob Phillips[_6_]

select listbox item automatically
 
Private Sub cmdRemove_Click()
Range("A1").Offset(ListBox1.ListIndex).Delete
Range("B1").Offset(ListBox1.ListIndex).Delete
End Sub

Private Sub ListBox1_Click()
ListBox2.ListIndex = ListBox1.ListIndex
End Sub

This assumes that the source of the listboxes is A1:A10, B1:B10

--
HTH

Bob Phillips

"ilyaskazi" wrote
in message ...

I hv 2 listboxes on userform..

If user is selecting the text of listbox1 then
get its index and select the text of listbox2(index of listbox1)
next also remove the selected item from both listboxes on clicking
remove btn.


--
ilyaskazi
------------------------------------------------------------------------
ilyaskazi's Profile:

http://www.excelforum.com/member.php...o&userid=23969
View this thread: http://www.excelforum.com/showthread...hreadid=467414




ilyaskazi[_72_]

select listbox item automatically
 

Although i wanted the help for userform's listbox, it is solved takin
some similar codes

It is perfect as always, Mr Bob.. Thankyou

--
ilyaskaz
-----------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...fo&userid=2396
View this thread: http://www.excelforum.com/showthread.php?threadid=46741


ilyaskazi[_73_]

select listbox item automatically
 

i do not want to accept any item in listbox if it is already existing

show msgbox of already exis

--
ilyaskaz
-----------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...fo&userid=2396
View this thread: http://www.excelforum.com/showthread.php?threadid=46741



All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com