Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tjh tjh is offline
external usenet poster
 
Posts: 96
Default listbox list

Hello,

I would like to create a list in a listbox on an Excel Form, based values in
column A that start with the word "Total." Is it possible to reference such a
list. Please let me know if I need to give more detail.

Thank You
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default listbox list

Hi
see:
http://www.contextures.com/xlDataVal01.html

if you mean the spreadsheet with 'Form'

--
Regards
Frank Kabel
Frankfurt, Germany

"tjh" schrieb im Newsbeitrag
...
Hello,

I would like to create a list in a listbox on an Excel Form, based

values in
column A that start with the word "Total." Is it possible to

reference such a
list. Please let me know if I need to give more detail.

Thank You


  #3   Report Post  
Posted to microsoft.public.excel.programming
tjh tjh is offline
external usenet poster
 
Posts: 96
Default listbox list

Sorry, I meant a VBA Form/Listbox. I think that your weblink almost covers
it, but how would I Add the list to the listbox on the form. I understand the
Data Validation Method on a spreadsheet, but how do I combine this function
with a VBA form listbox tool.

"Frank Kabel" wrote:

Hi
see:
http://www.contextures.com/xlDataVal01.html

if you mean the spreadsheet with 'Form'

--
Regards
Frank Kabel
Frankfurt, Germany

"tjh" schrieb im Newsbeitrag
...
Hello,

I would like to create a list in a listbox on an Excel Form, based

values in
column A that start with the word "Total." Is it possible to

reference such a
list. Please let me know if I need to give more detail.

Thank You



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default listbox list

I created a listbox on a userform and used this code:

Option Explicit
Private Sub UserForm_Initialize()

Dim myCell As Range
Dim myRng As Range
Dim myWord As String

myWord = "total"

With Worksheets("Sheet1")
Set myRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each myCell In myRng.Cells
If LCase(Left(myCell.Value, Len(myWord))) = LCase(myWord) Then
Me.ListBox1.AddItem myCell.Value
End If
Next myCell

End Sub


You may want to look at some code that John Walkenbach has shared:
http://j-walk.com/ss/excel/tips/tip47.htm

You may want to incorporate some of the stuff he did (unique entries and
sorting).

tjh wrote:

Hello,

I would like to create a list in a listbox on an Excel Form, based values in
column A that start with the word "Total." Is it possible to reference such a
list. Please let me know if I need to give more detail.

Thank You


--

Dave Peterson
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 Add to list Hank[_2_] Excel Programming 3 September 9th 04 03:10 PM
Making a Dynamic List in Listbox MikeM[_4_] Excel Programming 2 December 16th 03 04:16 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
ListBox List Code? Abdul[_4_] Excel Programming 1 October 10th 03 01:28 AM
Create ListBox (?) same as Find all Result List Soniya Excel Programming 1 October 2nd 03 01:22 PM


All times are GMT +1. The time now is 08:13 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"