LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Assign macro

I like to qualify my objects. Me.cboerby means that it's the cboerby that's
part of this userform.

Option Explicit
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
With Me.cboerby
.AddItem "JM"
.AddItem "PC"
.AddItem "JT"
End With
End Sub
Private Sub cmdok_Click()

If Me.cboerby.ListIndex < 0 Then
'do nothing, nothing selected
Else
Worksheets("sheet1").Range("G2") = Me.cboerby.Value
Unload Me '???
End If

End Sub

I plopped it into Worksheets("Sheet1"), too.

jenniferThomson wrote:

Hi

I appreciate the help already given but I need some more help with my
userform. So here goes:

File named Tender Information data entry, 4 worksheets, one named
Tender information is the sheet that the userform is attached. Button
called enter name

Private Sub cmdentername_Click()

frmTenderEnq.Show

End Sub

This enables me to press enter name and userform comes up.

I have the form codes

Private Sub UserForm_Initialize()

With cboerby
AddItem "JM"
AddItem "PC"
AddItem "JT"

End With

cboerby.Value = ""

End Sub

and an okay button on form

Private Sub cmdok_Click()

End Sub

This is were I need help I want the answer to go into cell G2 after
this button has been clicked but at the moment when I use the form
nothing happens.

What should I enter under Private Sub cmdok_Click() and before End Sub
to make this happen.

Any assistance would be greatly appreciated

Jennifer

--
jenniferThomson
------------------------------------------------------------------------
jenniferThomson's Profile: http://www.excelforum.com/member.php...fo&userid=4561
View this thread: http://www.excelforum.com/showthread...hreadid=467508


--

Dave Peterson
 
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
Assign Macro David Excel Worksheet Functions 1 October 9th 06 03:31 AM
assign a macro daidipya Excel Discussion (Misc queries) 4 May 30th 06 02:51 PM
Assign a Macro Pendelfin Excel Discussion (Misc queries) 1 January 10th 06 11:35 PM
How to assign a macro Mike Excel Discussion (Misc queries) 4 July 5th 05 06:43 AM
Un-assign a macro George Gee New Users to Excel 2 December 28th 04 05:44 PM


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