Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default BRAND NEW USER -: PROBLEMS WITH LIST AND TEXT BOX INPUT

BRAND NEW USER -: PROBLEMS WITH LIST AND TEXT BOX INPUT


I WOULD GREATLY APPRECIATE HELP WITH THESE PROBLEMS

1) I have a 3 sheet workbook
on sheet 2 I have a userform with a text box and a list box

my text box wont enter data anywhere I type data into it and when
I hit enter
it simply points to an undefined command button on the userform
I've got this code so far



What I want it to do is enter the data in ??????????????


2) I have a list box with no data in it.
I cant work out how to get the data to display in it

What I want it to do is

The list box is on sheet 2

"products" is Sheet 1
"clients" is Sheet 2
Sheet 3 is called "smmary"

But I want it to get the data from products entered on sheet 1 in
column "A"
Beginning at A2 and
display it for selection

I've used this code but nothing goes anywhere


Private Sub TextBox2_Change()

Dim TextBox2 As TextBox

Dim iRow As Long
Dim iCol As Long

Dim shtClientAdd As Worksheet
Set shtClientAdd = _
Application.Workbooks("Fiddling").Worksheets("clie nts")
TextBox2 = TextBox
With shtClientAdd
iRow = .Cells(.Rows.Count, "A").End(xlUp). _
Offset(1, 0).Row
iCol = .Cells(1, .Columns.Count).End(xlToLeft). _
Offset(0, 1).Column
End With

End Sub



I've also inexpertly hacked this into the userform code

Private Sub ClientForm_Initialize()

'declare variables
Dim strid As String, rngData As Range, rngCell As Range
'assigns address of Product Names to rngData variables
Set rngData = _
Application.Workbooks("Fiddling.xls").Worksheets(" products") _
.Range("A2").ProductName '.strProductName
'assign column heading to strid variable
strid = "strProductName"
'sort sales data THEN ADD ONLY UNIQUE ID'S
'TO LIST BOX
rngData.Sort.key1 = strid ', header:=x1Yes
For Each rngCell In rngData.Columns(1).Cells
If rngCell.Value < strid Then
ListBox1.AddItem rngCell.Value
strid = rngCell.Value
End If
Next rngCell
End Sub
Private Sub ListBox1_Click()


Dim ListBox1 As ListBox
'select ............default list box
'lstBox1.ListIndex = 0
'select default option button
'optTotal.Value = True
ListBox1.AddItem "M&M's plain (500g)"
ListBox1.AddItem "M&M's peanut (500g)"
ListBox1.AddItem "Cadbury Cherry Ripe Bars (300g)"
ListBox1.AddItem "Cadbury Twirl Bars (300g)"
ListBox1.AddItem "Cadbury Caramello Bars (300g)"
ListBox1.AddItem "Cadbury Snack Bars (300g)"
ListBox1.AddItem "Cadbury Peppermint Bars (300g)"
ListBox1.AddItem "Cadbury Hazelnut Bars (300g)"

End Sub

From the notes Ive got the value property in the properties is

significant
But it seems useless to me...I cannot enter string data there

I would appreciate any useful code or advice

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
Dropdown List That Accepts Other User Input GEdwards Excel Discussion (Misc queries) 5 April 5th 10 05:45 AM
Averaging values from a list, based on user input MWS Excel Worksheet Functions 3 June 5th 07 06:47 PM
HELP! Brand new user to excel and having problems... rdenny1900 Excel Discussion (Misc queries) 5 June 20th 05 01:37 PM
Check a user-input value against a list of values? Bill_S Excel Programming 1 April 28th 05 03:24 AM
Random Brand selection from list zaisaki[_2_] Excel Programming 0 September 11th 04 08:57 PM


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