LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Creating Lookup User Form

merjet,

Sorry about the long message previously posted.

I have figured out why I got an error. I got an error because I inserted a
cell reference in the ControlSource of combo box. When I removed it, I was
no longer receiving errors. However, I am no longer able to list my values
"student numbers" in the combo box, even though I have "B:B" in the
RowSource.

Do you know how I can list student numbers in the combo box? The student
numbers are in column B.

Thanks.

"merjet" wrote:

Suppose the data is in columns A-C of Sheet1, with #
in column B. Set the ComboBox's RowSource property
like this: Sheet1!B2:B6

Put the following code in the UserForm's code module:

Private Sub ComboBox1_Change()
Dim rng As Range
With ComboBox1
If .ListIndex = -1 Then
TextBox1 = ""
TextBox2 = ""
Else
Set rng = Range(.RowSource)(.ListIndex + 1)
TextBox1 = rng.Offset(0, -1)
TextBox2 = rng.Offset(0, 1)
End If
End With
End Sub

Hth,
Merjet

 
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
Creating multi-user Excel form for online DownSouthLeftie Excel Discussion (Misc queries) 0 November 27th 09 04:31 AM
Creating a user interface form Thi Navy Excel Discussion (Misc queries) 1 September 21st 08 08:28 PM
Creating a User Form to update a list Gary Hall Excel Programming 1 January 4th 04 03:02 PM
creating a checkbox control on a user form using VBA Tim Marsh[_2_] Excel Programming 3 December 8th 03 02:51 AM
Creating a list box in a user form Heather[_6_] Excel Programming 0 September 30th 03 09:34 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"