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: 61
Default checkbox code needed

Thanks Tom. That worked perfectly. Thanks to yourself as well Gary however
Toms code did the trick as I have code that checks the values within the
checkboxes elswhere.
Much Appreciated.

"Tom Hutchins" wrote:

Try this in your userform code (you may have to change the object names):

Private Sub UserForm_Terminate()
Dim OutStr As String
If Me.CheckBox1.Value = True Then
OutStr$ = "Mech & "
End If
If Me.CheckBox2.Value = True Then
OutStr$ = OutStr$ & "Elect & "
End If
If Me.CheckBox3.Value = True Then
OutStr$ = OutStr$ & "Inst/FET & "
End If
ActiveCell.Offset(0, 9).Value = Left(OutStr$, Len(OutStr$) - 3)
End Sub

Hope this helps,

Hutch

"Woodi2" wrote:

I have 3 checkboxes on a userform. The Userform is opened if anycell in
range C4:C100 is selected. Checkbox 1 if true = "Mech", Checkbox 2 if true =
"Elect" and Checkbox 3 if true = "Inst/FET".
I need some code so that if for example Checkbox 1 and 2 are true, then
Activecell.offset (0,9) is returned with Mech & Elect.
Similiarly, if Checkbox 1, 2 and 3 are true it returns Mech & Elect &
Inst/FET.
I need this to work in all combinations. Is it possible?

 
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
checkbox and textbox help needed pswanie Excel Programming 0 July 17th 08 08:26 AM
checkbox help needed pswanie Excel Programming 0 July 16th 08 11:22 PM
Help with checkbox code Mekinnik Excel Programming 1 October 16th 07 08:40 PM
help in checkbox code Soniya[_4_] Excel Programming 1 April 24th 05 01:49 PM
Checkbox Code Edwin Tam[_2_] Excel Programming 0 January 14th 04 02:26 AM


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