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

Sorry this is a re-post because im still looking for some type of anser or
direction.

My question and response to Tom's Help is, 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?

Thank you!!

"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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Re-Post: Sorting Listbox Source

What does that mean?

Private Sub CommandButton7_Click()

If ComboBox6.Text = "Selection of Items" Then
Listbox61.Rowsource = ""
set rng = worksheets("BCK").Range("Selection_Of_Items")
rng.sort key1:=rng(1), order1:=xlAscending
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If

End sub

--
Regards,
Tom Ogilvy

End Sub


"Benz" wrote:

Sorry this is a re-post because im still looking for some type of anser or
direction.

My question and response to Tom's Help is, 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?

Thank you!!

"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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Re-Post: Sorting Listbox Source

i think she's unsure about where she can put the range of data
populating the combobox.
i believe you can use a hidden sheet, which will give you access to
changing it, etc., but keep it hidden (obviously!) from your users
except thru their use of the userform.
hope this helps!
susan

On Feb 20, 12:43 pm, Tom Ogilvy
wrote:
What does that mean?

Private Sub CommandButton7_Click()

If ComboBox6.Text = "Selection of Items" Then
Listbox61.Rowsource = ""
set rng = worksheets("BCK").Range("Selection_Of_Items")
rng.sort key1:=rng(1), order1:=xlAscending
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If

End sub

--
Regards,
Tom Ogilvy

End Sub



"Benz" wrote:
Sorry this is a re-post because im still looking for some type of anser or
direction.


My question and response to Tom's Help is, 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?


Thank you!!


"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- Hide quoted text -


- Show quoted text -



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Re-Post: Sorting Listbox Source

sorry..............
i think THEY'RE unsure about where THEY can put the data............
:)
susan

On Feb 20, 12:53 pm, "Susan" wrote:
i think she's unsure about where she can put the range of data
populating the combobox.
i believe you can use a hidden sheet, which will give you access to
changing it, etc., but keep it hidden (obviously!) from your users
except thru their use of the userform.
hope this helps!
susan

On Feb 20, 12:43 pm, Tom Ogilvy
wrote:



What does that mean?


Private Sub CommandButton7_Click()


If ComboBox6.Text = "Selection of Items" Then
Listbox61.Rowsource = ""
set rng = worksheets("BCK").Range("Selection_Of_Items")
rng.sort key1:=rng(1), order1:=xlAscending
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If


End sub


--
Regards,
Tom Ogilvy


End Sub


"Benz" wrote:
Sorry this is a re-post because im still looking for some type of anser or
direction.


My question and response to Tom's Help is, 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?


Thank you!!


"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- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Re-Post: Sorting Listbox Source

as long as the data is on a sheet in the same workbook as the userform, it
doesn't make any difference in terms of the abililty of the userform to use
that data. That sheet can be hidden or visible.

--
regards,
Tom Ogilvy




"Susan" wrote:

sorry..............
i think THEY'RE unsure about where THEY can put the data............
:)
susan

On Feb 20, 12:53 pm, "Susan" wrote:
i think she's unsure about where she can put the range of data
populating the combobox.
i believe you can use a hidden sheet, which will give you access to
changing it, etc., but keep it hidden (obviously!) from your users
except thru their use of the userform.
hope this helps!
susan

On Feb 20, 12:43 pm, Tom Ogilvy
wrote:



What does that mean?


Private Sub CommandButton7_Click()


If ComboBox6.Text = "Selection of Items" Then
Listbox61.Rowsource = ""
set rng = worksheets("BCK").Range("Selection_Of_Items")
rng.sort key1:=rng(1), order1:=xlAscending
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If


End sub


--
Regards,
Tom Ogilvy


End Sub


"Benz" wrote:
Sorry this is a re-post because im still looking for some type of anser or
direction.


My question and response to Tom's Help is, 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?


Thank you!!


"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- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Re-Post: Sorting Listbox Source

What I mean is how would I go about changing the order of the data-list in a
userform? or change the rowsource? I need the 3 things to work together. If
this isint making sesne I can e-mail my workbook. I've been trying to get
this all morning lol.

Thank you for your help :)

"Tom Ogilvy" wrote:

as long as the data is on a sheet in the same workbook as the userform, it
doesn't make any difference in terms of the abililty of the userform to use
that data. That sheet can be hidden or visible.

--
regards,
Tom Ogilvy




"Susan" wrote:

sorry..............
i think THEY'RE unsure about where THEY can put the data............
:)
susan

On Feb 20, 12:53 pm, "Susan" wrote:
i think she's unsure about where she can put the range of data
populating the combobox.
i believe you can use a hidden sheet, which will give you access to
changing it, etc., but keep it hidden (obviously!) from your users
except thru their use of the userform.
hope this helps!
susan

On Feb 20, 12:43 pm, Tom Ogilvy
wrote:



What does that mean?

Private Sub CommandButton7_Click()

If ComboBox6.Text = "Selection of Items" Then
Listbox61.Rowsource = ""
set rng = worksheets("BCK").Range("Selection_Of_Items")
rng.sort key1:=rng(1), order1:=xlAscending
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If

End sub

--
Regards,
Tom Ogilvy

End Sub

"Benz" wrote:
Sorry this is a re-post because im still looking for some type of anser or
direction.

My question and response to Tom's Help is, 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?

Thank you!!

"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- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Re-Post: Sorting Listbox Source

If that is the question, I think I answered the question.

--
Regards,
Tom Ogilvy


"Benz" wrote:

What I mean is how would I go about changing the order of the data-list in a
userform? or change the rowsource? I need the 3 things to work together. If
this isint making sesne I can e-mail my workbook. I've been trying to get
this all morning lol.

Thank you for your help :)

"Tom Ogilvy" wrote:

as long as the data is on a sheet in the same workbook as the userform, it
doesn't make any difference in terms of the abililty of the userform to use
that data. That sheet can be hidden or visible.

--
regards,
Tom Ogilvy




"Susan" wrote:

sorry..............
i think THEY'RE unsure about where THEY can put the data............
:)
susan

On Feb 20, 12:53 pm, "Susan" wrote:
i think she's unsure about where she can put the range of data
populating the combobox.
i believe you can use a hidden sheet, which will give you access to
changing it, etc., but keep it hidden (obviously!) from your users
except thru their use of the userform.
hope this helps!
susan

On Feb 20, 12:43 pm, Tom Ogilvy
wrote:



What does that mean?

Private Sub CommandButton7_Click()

If ComboBox6.Text = "Selection of Items" Then
Listbox61.Rowsource = ""
set rng = worksheets("BCK").Range("Selection_Of_Items")
rng.sort key1:=rng(1), order1:=xlAscending
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If

End sub

--
Regards,
Tom Ogilvy

End Sub

"Benz" wrote:
Sorry this is a re-post because im still looking for some type of anser or
direction.

My question and response to Tom's Help is, 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?

Thank you!!

"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- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Re-Post: Sorting Listbox Source

I see now sorry a little slow at this. This is almost it, except I dont want
it to Ascend sort but rather move the cell up one, or down , and one to make
the cell to the very top. So three Buttons total.

"Tom Ogilvy" wrote:

If that is the question, I think I answered the question.

--
Regards,
Tom Ogilvy


"Benz" wrote:

What I mean is how would I go about changing the order of the data-list in a
userform? or change the rowsource? I need the 3 things to work together. If
this isint making sesne I can e-mail my workbook. I've been trying to get
this all morning lol.

Thank you for your help :)

"Tom Ogilvy" wrote:

as long as the data is on a sheet in the same workbook as the userform, it
doesn't make any difference in terms of the abililty of the userform to use
that data. That sheet can be hidden or visible.

--
regards,
Tom Ogilvy




"Susan" wrote:

sorry..............
i think THEY'RE unsure about where THEY can put the data............
:)
susan

On Feb 20, 12:53 pm, "Susan" wrote:
i think she's unsure about where she can put the range of data
populating the combobox.
i believe you can use a hidden sheet, which will give you access to
changing it, etc., but keep it hidden (obviously!) from your users
except thru their use of the userform.
hope this helps!
susan

On Feb 20, 12:43 pm, Tom Ogilvy
wrote:



What does that mean?

Private Sub CommandButton7_Click()

If ComboBox6.Text = "Selection of Items" Then
Listbox61.Rowsource = ""
set rng = worksheets("BCK").Range("Selection_Of_Items")
rng.sort key1:=rng(1), order1:=xlAscending
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If

End sub

--
Regards,
Tom Ogilvy

End Sub

"Benz" wrote:
Sorry this is a re-post because im still looking for some type of anser or
direction.

My question and response to Tom's Help is, 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?

Thank you!!

"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- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Re-Post: Sorting Listbox Source

Not sure what that means. Are you having the user move items in the list?

--
Regards,
Tom Ogilvy


"Benz" wrote:

I see now sorry a little slow at this. This is almost it, except I dont want
it to Ascend sort but rather move the cell up one, or down , and one to make
the cell to the very top. So three Buttons total.

"Tom Ogilvy" wrote:

If that is the question, I think I answered the question.

--
Regards,
Tom Ogilvy


"Benz" wrote:

What I mean is how would I go about changing the order of the data-list in a
userform? or change the rowsource? I need the 3 things to work together. If
this isint making sesne I can e-mail my workbook. I've been trying to get
this all morning lol.

Thank you for your help :)

"Tom Ogilvy" wrote:

as long as the data is on a sheet in the same workbook as the userform, it
doesn't make any difference in terms of the abililty of the userform to use
that data. That sheet can be hidden or visible.

--
regards,
Tom Ogilvy




"Susan" wrote:

sorry..............
i think THEY'RE unsure about where THEY can put the data............
:)
susan

On Feb 20, 12:53 pm, "Susan" wrote:
i think she's unsure about where she can put the range of data
populating the combobox.
i believe you can use a hidden sheet, which will give you access to
changing it, etc., but keep it hidden (obviously!) from your users
except thru their use of the userform.
hope this helps!
susan

On Feb 20, 12:43 pm, Tom Ogilvy
wrote:



What does that mean?

Private Sub CommandButton7_Click()

If ComboBox6.Text = "Selection of Items" Then
Listbox61.Rowsource = ""
set rng = worksheets("BCK").Range("Selection_Of_Items")
rng.sort key1:=rng(1), order1:=xlAscending
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If

End sub

--
Regards,
Tom Ogilvy

End Sub

"Benz" wrote:
Sorry this is a re-post because im still looking for some type of anser or
direction.

My question and response to Tom's Help is, 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?

Thank you!!

"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- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Re-Post: Sorting Listbox Source

Yes, sorry not sorting but re-ordering so if there was a list of Items( Item
A, Item B, Item C, Item D) that came up after the user selected "Selection Of
Items" in combobox6 then they could move Item D above Item A for example.
That is what I am trying to accomplish.

Thank you for being so patient with me.

"Tom Ogilvy" wrote:

Not sure what that means. Are you having the user move items in the list?

--
Regards,
Tom Ogilvy


"Benz" wrote:

I see now sorry a little slow at this. This is almost it, except I dont want
it to Ascend sort but rather move the cell up one, or down , and one to make
the cell to the very top. So three Buttons total.

"Tom Ogilvy" wrote:

If that is the question, I think I answered the question.

--
Regards,
Tom Ogilvy


"Benz" wrote:

What I mean is how would I go about changing the order of the data-list in a
userform? or change the rowsource? I need the 3 things to work together. If
this isint making sesne I can e-mail my workbook. I've been trying to get
this all morning lol.

Thank you for your help :)

"Tom Ogilvy" wrote:

as long as the data is on a sheet in the same workbook as the userform, it
doesn't make any difference in terms of the abililty of the userform to use
that data. That sheet can be hidden or visible.

--
regards,
Tom Ogilvy




"Susan" wrote:

sorry..............
i think THEY'RE unsure about where THEY can put the data............
:)
susan

On Feb 20, 12:53 pm, "Susan" wrote:
i think she's unsure about where she can put the range of data
populating the combobox.
i believe you can use a hidden sheet, which will give you access to
changing it, etc., but keep it hidden (obviously!) from your users
except thru their use of the userform.
hope this helps!
susan

On Feb 20, 12:43 pm, Tom Ogilvy
wrote:



What does that mean?

Private Sub CommandButton7_Click()

If ComboBox6.Text = "Selection of Items" Then
Listbox61.Rowsource = ""
set rng = worksheets("BCK").Range("Selection_Of_Items")
rng.sort key1:=rng(1), order1:=xlAscending
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If

End sub

--
Regards,
Tom Ogilvy

End Sub

"Benz" wrote:
Sorry this is a re-post because im still looking for some type of anser or
direction.

My question and response to Tom's Help is, 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?

Thank you!!

"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- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -





  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Re-Post: Sorting Listbox Source

Use a spin button

This worked for me.


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


Private Sub SpinButton1_SpinUp()
Dim l As msforms.ListBox, rng As Range, idex As Long, t As Variant
Dim r1 As Range, r2 As Range
Set l = ListBox61
Set rng = Worksheets("BCK").Range("Selection_Of_Items")
idex = l.ListIndex
If idex = -1 Then Exit Sub
If idex = 0 Then Exit Sub
l.RowSource = ""
Set r1 = rng(idex + 1)
Set r2 = rng(idex)
t = r2.Value
r2.Value = r1.Value
r1.Value = t
SpinButton1.Value = 0
l.RowSource = "BCK!Selection_Of_Items"
l.ListIndex = idex - 1
End Sub

Private Sub SpinButton1_SpinDown()
Dim l As msforms.ListBox, rng As Range, idex As Long, t As Variant
Dim r1 As Range, r2 As Range
Set l = ListBox61
Set rng = Worksheets("BCK").Range("Selection_Of_Items")
idex = l.ListIndex
If idex = -1 Then Exit Sub
If idex = l.ListCount - 1 Then Exit Sub
l.RowSource = ""
Set r1 = rng(idex + 1)
Set r2 = rng(idex + 2)
t = r2.Value
r2.Value = r1.Value
r1.Value = t
SpinButton1.Value = 0
l.RowSource = "BCK!Selection_Of_Items"
l.ListIndex = idex + 1
End Sub



--
Regards,
Tom Ogilvy



"Benz" wrote in message
...
Yes, sorry not sorting but re-ordering so if there was a list of Items(
Item
A, Item B, Item C, Item D) that came up after the user selected "Selection
Of
Items" in combobox6 then they could move Item D above Item A for example.
That is what I am trying to accomplish.

Thank you for being so patient with me.

"Tom Ogilvy" wrote:

Not sure what that means. Are you having the user move items in the
list?

--
Regards,
Tom Ogilvy


"Benz" wrote:

I see now sorry a little slow at this. This is almost it, except I
dont want
it to Ascend sort but rather move the cell up one, or down , and one to
make
the cell to the very top. So three Buttons total.

"Tom Ogilvy" wrote:

If that is the question, I think I answered the question.

--
Regards,
Tom Ogilvy


"Benz" wrote:

What I mean is how would I go about changing the order of the
data-list in a
userform? or change the rowsource? I need the 3 things to work
together. If
this isint making sesne I can e-mail my workbook. I've been trying
to get
this all morning lol.

Thank you for your help :)

"Tom Ogilvy" wrote:

as long as the data is on a sheet in the same workbook as the
userform, it
doesn't make any difference in terms of the abililty of the
userform to use
that data. That sheet can be hidden or visible.

--
regards,
Tom Ogilvy




"Susan" wrote:

sorry..............
i think THEY'RE unsure about where THEY can put the
data............
:)
susan

On Feb 20, 12:53 pm, "Susan" wrote:
i think she's unsure about where she can put the range of
data
populating the combobox.
i believe you can use a hidden sheet, which will give you
access to
changing it, etc., but keep it hidden (obviously!) from your
users
except thru their use of the userform.
hope this helps!
susan

On Feb 20, 12:43 pm, Tom Ogilvy

wrote:



What does that mean?

Private Sub CommandButton7_Click()

If ComboBox6.Text = "Selection of Items" Then
Listbox61.Rowsource = ""
set rng =
worksheets("BCK").Range("Selection_Of_Items")
rng.sort key1:=rng(1), order1:=xlAscending
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If

End sub

--
Regards,
Tom Ogilvy

End Sub

"Benz" wrote:
Sorry this is a re-post because im still looking for some
type of anser or
direction.

My question and response to Tom's Help is, 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?

Thank you!!

"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- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -





  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Re-Post: Sorting Listbox Source

This worked perfect! Thank you so much Tom!

"Tom Ogilvy" wrote:

Use a spin button

This worked for me.


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


Private Sub SpinButton1_SpinUp()
Dim l As msforms.ListBox, rng As Range, idex As Long, t As Variant
Dim r1 As Range, r2 As Range
Set l = ListBox61
Set rng = Worksheets("BCK").Range("Selection_Of_Items")
idex = l.ListIndex
If idex = -1 Then Exit Sub
If idex = 0 Then Exit Sub
l.RowSource = ""
Set r1 = rng(idex + 1)
Set r2 = rng(idex)
t = r2.Value
r2.Value = r1.Value
r1.Value = t
SpinButton1.Value = 0
l.RowSource = "BCK!Selection_Of_Items"
l.ListIndex = idex - 1
End Sub

Private Sub SpinButton1_SpinDown()
Dim l As msforms.ListBox, rng As Range, idex As Long, t As Variant
Dim r1 As Range, r2 As Range
Set l = ListBox61
Set rng = Worksheets("BCK").Range("Selection_Of_Items")
idex = l.ListIndex
If idex = -1 Then Exit Sub
If idex = l.ListCount - 1 Then Exit Sub
l.RowSource = ""
Set r1 = rng(idex + 1)
Set r2 = rng(idex + 2)
t = r2.Value
r2.Value = r1.Value
r1.Value = t
SpinButton1.Value = 0
l.RowSource = "BCK!Selection_Of_Items"
l.ListIndex = idex + 1
End Sub



--
Regards,
Tom Ogilvy



"Benz" wrote in message
...
Yes, sorry not sorting but re-ordering so if there was a list of Items(
Item
A, Item B, Item C, Item D) that came up after the user selected "Selection
Of
Items" in combobox6 then they could move Item D above Item A for example.
That is what I am trying to accomplish.

Thank you for being so patient with me.

"Tom Ogilvy" wrote:

Not sure what that means. Are you having the user move items in the
list?

--
Regards,
Tom Ogilvy


"Benz" wrote:

I see now sorry a little slow at this. This is almost it, except I
dont want
it to Ascend sort but rather move the cell up one, or down , and one to
make
the cell to the very top. So three Buttons total.

"Tom Ogilvy" wrote:

If that is the question, I think I answered the question.

--
Regards,
Tom Ogilvy


"Benz" wrote:

What I mean is how would I go about changing the order of the
data-list in a
userform? or change the rowsource? I need the 3 things to work
together. If
this isint making sesne I can e-mail my workbook. I've been trying
to get
this all morning lol.

Thank you for your help :)

"Tom Ogilvy" wrote:

as long as the data is on a sheet in the same workbook as the
userform, it
doesn't make any difference in terms of the abililty of the
userform to use
that data. That sheet can be hidden or visible.

--
regards,
Tom Ogilvy




"Susan" wrote:

sorry..............
i think THEY'RE unsure about where THEY can put the
data............
:)
susan

On Feb 20, 12:53 pm, "Susan" wrote:
i think she's unsure about where she can put the range of
data
populating the combobox.
i believe you can use a hidden sheet, which will give you
access to
changing it, etc., but keep it hidden (obviously!) from your
users
except thru their use of the userform.
hope this helps!
susan

On Feb 20, 12:43 pm, Tom Ogilvy

wrote:



What does that mean?

Private Sub CommandButton7_Click()

If ComboBox6.Text = "Selection of Items" Then
Listbox61.Rowsource = ""
set rng =
worksheets("BCK").Range("Selection_Of_Items")
rng.sort key1:=rng(1), order1:=xlAscending
ListBox61.RowSource = "BCK!Selection_of_Items"
List61.ListIndex = List61.ListIndex - 1
End If

End sub

--
Regards,
Tom Ogilvy

End Sub

"Benz" wrote:
Sorry this is a re-post because im still looking for some
type of anser or
direction.

My question and response to Tom's Help is, 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?

Thank you!!

"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- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -






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
Sorting ListBox Source Benz Excel Programming 2 February 19th 07 10:54 PM
Repost: ListBox Headings - customized! Class Module (warning: long post)" Robots Excel Programming 4 July 19th 04 09:01 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 07:12 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"