Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default ComboBox in a Userforn to display a column...

ok...here is my code...

.................................................. .............................

Private Sub OpenWORDButton_Click()

Dim WordObj As Object, FileNm As String
Dim Doc As Object

Err.Clear

On Error Resume Next
Set WordObj = GetObject(, "Word.Application")

If Err.number = 429 Then
Set WordObj = CreateObject("Word.Application")
End If

FileNm = "j:\database\Template.doc"

WordObj.Visible = True
WordObj.Activate
Set Doc = WordObj.Documents(FileNm)

If Doc Is Nothing Then
Set Doc = WordObj.Documents.Open(FileNm)
End If

On Error GoTo 0

End Sub



Private Sub ComboBox1_Change()

Dim employeename As String
Dim employeeno As String
Dim employeeclass As String

ComboBox1.RowSource = employeename.Value

r = 2
Do While Cells(r, 1) < ""
If Cells(r, 2) = employeename Then
getinfo.employeeno = Cells(r, 1)
getinfo.employeeclass = Cells(r, 3)
Exit Do
End If
r = r + 1
Loop

End Sub

.................................................. ........................................

"stump5150" wrote:

ok...what I am trying to do is:

1. Pull column (B) data into "getinfo" (userform) into ComboBox1...
2. When a name is picked from the ComboBox1, it pulls the associated row
data...
(i.e. Employee Number, ClassRoom, etc) and places it into labels also
in the userforn to view (but not to edit)...
3. Click a button that will open a MSWord document and take that data
and place it into specific insert fields

If you email me at: is will send you my working
file so
you can review my code and pointing out what I am doing wrong.
Thanks a lot.

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
Combobox display on startup Richard New Users to Excel 5 September 6th 05 01:02 PM
MultiColumn ComboBox Value set/display Jim Zeeb[_2_] Excel Programming 5 June 13th 05 09:20 AM
Display initial value in combobox mworth01[_4_] Excel Programming 5 October 9th 04 08:29 PM
Combobox & Display Bhuktar S[_12_] Excel Programming 1 October 2nd 04 01:14 AM
Format Display in ComboBox King[_4_] Excel Programming 2 October 13th 03 06:06 PM


All times are GMT +1. The time now is 11:19 AM.

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"