Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Sorting ListBox Source

Hello,

I'm not the greatest at VBA so hopefully this makes sense. I have a user
form where the user selects a from combo box 6 different text example "
Selection of Items" then in ListBox 61 comes specifiic data in pulled from a
defined area in the work book. Im trying to figure out how to do 2 things.

1. create a command button ( I tried to create one using the code below)
that will move a selected item in ListBox61 up or down.
2. Create a command button that will move the selected item to the top of
the list.

I'm having trouble doing this because everything I try then prevents the
information to be put into Listbox 61 depending on what the user selects in
combo box 6.

Any help would be appreciated.

Thank you.

Private Sub CommandButton7_Click()

If ComboBox6.Text = "Selection of Items" Then
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Sorting ListBox Source

since your using rowsource to fill your listbox, you will have to move the
data on the worksheet.

--
Regards,
Tom Ogilvy



"Benz" wrote:

Hello,

I'm not the greatest at VBA so hopefully this makes sense. I have a user
form where the user selects a from combo box 6 different text example "
Selection of Items" then in ListBox 61 comes specifiic data in pulled from a
defined area in the work book. Im trying to figure out how to do 2 things.

1. create a command button ( I tried to create one using the code below)
that will move a selected item in ListBox61 up or down.
2. Create a command button that will move the selected item to the top of
the list.

I'm having trouble doing this because everything I try then prevents the
information to be put into Listbox 61 depending on what the user selects in
combo box 6.

Any help would be appreciated.

Thank you.

Private Sub CommandButton7_Click()

If ComboBox6.Text = "Selection of Items" Then
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Sorting ListBox Source

can I move the data in the worksheet while still giving the user the ease of
use of the userform? or can you point me in an easier direction?

"Tom Ogilvy" wrote:

since your using rowsource to fill your listbox, you will have to move the
data on the worksheet.

--
Regards,
Tom Ogilvy



"Benz" wrote:

Hello,

I'm not the greatest at VBA so hopefully this makes sense. I have a user
form where the user selects a from combo box 6 different text example "
Selection of Items" then in ListBox 61 comes specifiic data in pulled from a
defined area in the work book. Im trying to figure out how to do 2 things.

1. create a command button ( I tried to create one using the code below)
that will move a selected item in ListBox61 up or down.
2. Create a command button that will move the selected item to the top of
the list.

I'm having trouble doing this because everything I try then prevents the
information to be put into Listbox 61 depending on what the user selects in
combo box 6.

Any help would be appreciated.

Thank you.

Private Sub CommandButton7_Click()

If ComboBox6.Text = "Selection of Items" Then
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If
End Sub

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
ListBox external source DoctorG Excel Programming 4 July 18th 07 03:32 AM
ListBox - Row Source problem unplugs[_39_] Excel Programming 2 July 2nd 04 02:28 AM
ListBox - Row Source problem unplugs[_40_] Excel Programming 0 June 30th 04 05:01 AM
listbox.row source baha[_5_] Excel Programming 1 November 28th 03 08:30 AM
Sorting ListBox results or transposing ListBox values to other cells for sorting Rob[_8_] Excel Programming 1 July 9th 03 04:35 AM


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

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"