Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Listbox multi selection

Hi,
I have a lisbox worksheet based:
John
Mario
Maria
Charles

What I want: mark John and Maria and in contiguos cell appear number 1:
A1 B1
John 1

A3 B3
Maria 1

Thanks in advance

Jorge


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Listbox multi selection

"Jorge Rodrigues" wrote in message
...
Hi,
I have a lisbox worksheet based:
John
Mario
Maria
Charles

What I want: mark John and Maria and in contiguos cell appear number 1:
A1 B1
John 1

A3 B3
Maria 1


Not quite sure eactly what you mean. I'm going to guess its:
You have a list of names in a ListBox. Whatever names are selected should
be placed on the sheet in column A, on the row they appear in the listbox.
A 1 should be placed next to them in column B. Which is:

assuming your listbox is called MyList and your worksheet is called
MySheet:

dim r as long

for r = 1 to MyList.ListCount - 1
if MyList.Selected( r) then
Sheets("MySheet").Cells( r, 1).Value = MyList.List(r)
Sheets("MySheet").Cells( r, 2).Value = 1
endif
next


Iain King


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Listbox multi selection

Hi, Iain:
Thanks for your help. However, the problem is that the names are in the
sheet, I mean from B10:B50 and the ListBox source is from B10:B50. So the
only thing that I want is to choose a name from this list, for example B15
(Jorge) and as I click in that name, it appears in C15 the number 1 and so
on if I click in other names in List. I don't know if I could explain right
away, excuse me, please. Can you be so kind in order to help me again? I
thank you in advance.
Jorge
"Iain King" escreveu na mensagem
...
"Jorge Rodrigues" wrote in message
...
Hi,
I have a lisbox worksheet based:
John
Mario
Maria
Charles

What I want: mark John and Maria and in contiguos cell appear number 1:
A1 B1
John 1

A3 B3
Maria 1


Not quite sure eactly what you mean. I'm going to guess its:
You have a list of names in a ListBox. Whatever names are selected should
be placed on the sheet in column A, on the row they appear in the listbox.
A 1 should be placed next to them in column B. Which is:

assuming your listbox is called MyList and your worksheet is called
MySheet:

dim r as long

for r = 1 to MyList.ListCount - 1
if MyList.Selected( r) then
Sheets("MySheet").Cells( r, 1).Value = MyList.List(r)
Sheets("MySheet").Cells( r, 2).Value = 1
endif
next


Iain King




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Listbox multi selection

Hi again!
Never mind Iain! I found out what was the problem and now is solved with a
little modifying of your hint:
Dim r As Long

For r = 1 To ListBox1.ListCount - 1

If ListBox1.Selected(r) Then
Sheets("List_Grat").Cells((r + 10), 5).Value = 1
End If
Next

"Jorge Rodrigues" escreveu na mensagem
...
Hi, Iain:
Thanks for your help. However, the problem is that the names are in the
sheet, I mean from B10:B50 and the ListBox source is from B10:B50. So the
only thing that I want is to choose a name from this list, for example B15
(Jorge) and as I click in that name, it appears in C15 the number 1 and so
on if I click in other names in List. I don't know if I could explain

right
away, excuse me, please. Can you be so kind in order to help me again? I
thank you in advance.
Jorge
"Iain King" escreveu na mensagem
...
"Jorge Rodrigues" wrote in message
...
Hi,
I have a lisbox worksheet based:
John
Mario
Maria
Charles

What I want: mark John and Maria and in contiguos cell appear number

1:
A1 B1
John 1

A3 B3
Maria 1


Not quite sure eactly what you mean. I'm going to guess its:
You have a list of names in a ListBox. Whatever names are selected

should
be placed on the sheet in column A, on the row they appear in the

listbox.
A 1 should be placed next to them in column B. Which is:

assuming your listbox is called MyList and your worksheet is called
MySheet:

dim r as long

for r = 1 to MyList.ListCount - 1
if MyList.Selected( r) then
Sheets("MySheet").Cells( r, 1).Value = MyList.List(r)
Sheets("MySheet").Cells( r, 2).Value = 1
endif
next


Iain King






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
Multi-field listbox in an Excel form Lee S. Excel Discussion (Misc queries) 0 September 14th 06 10:19 PM
multi select listbox Paul Mueller Excel Programming 2 June 10th 04 09:08 PM
populating a multi-column Listbox Tom Ogilvy Excel Programming 3 April 26th 04 08:26 PM
populating a multi-column Listbox Harald Staff Excel Programming 1 April 26th 04 08:26 PM
Multi-columns in a ListBox Tom Atkisson Excel Programming 1 October 5th 03 10:27 PM


All times are GMT +1. The time now is 10:40 PM.

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"