Thread: Check Boxes
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Office_Novice Office_Novice is offline
external usenet poster
 
Posts: 245
Default Check Boxes

Forgive me i had made a few assumptions. Step by Step what i what you to do:
1. Open Excel
2. press at the same time Alt +F11
Result: You'll see the "VBE" (Visual Basic Editor)
3.View --Project Explorer
4.Right Click"VBAProject(Book1) " this may vary slightly
5. Insert -- UserForm
6. Add a Check box from the Control toolbox
7. add a frame control in the same way
8. add a couple of textboxes inside the frame
after you have added all your control fro the example
click somewhwere on the userform
9. hit F7 this will show you where the code goes
10.Delete everything thats there and Copt and paste this:

option Explicit
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
Frame1.Visible = True
ElseIf CheckBox1 = False Then
Frame1.Visible = False
End If
End Sub

Private Sub UserForm_Initialize()
Me.Frame1.Visible = False
End Sub

11. Hit F5 this should run the uesr form check and uncheck the box to see
what happens.


"girlnc16" wrote:

OK you lost me at "this example" i sorta get that the code need to be entered
somewhere but not sure where or how i thought i did when i tried it before
but it didnt work so i must have done something wrong....can you break it
down like what button and where to go???

"Office_Novice" wrote:

The good news is your on the right track A userform souds like the way to go
for what your doing. I would suggest the first Checkbox Controls a frame
control with textboxes' in it to collect user info. that will look somthing
like this.
This Example has a Checkbox Control a Frame Control a couple of textboxes on
a user form After adding the controls hit F5 or the "play" button in the VBE
to run the userform If all goes well when you click the check box the frame
should show up

Option Explicit
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
Frame1.Visible = True
ElseIf CheckBox1 = False Then
Frame1.Visible = False
End If
End Sub

Private Sub UserForm_Initialize()
Me.Frame1.Visible = False
End Sub
"girlnc16" wrote:

ok i have three buttons i want to be able to select one will be citizen
complaints if i select this box i want to have a box show where their contact
info can be entered...then second box will be dept observed once selected i
want to be able to select a dept from a menu....third button also needs a
space to enter a person and contact info....i hvae some other places on the
sheet where i need to just be able to select a button with no box
text....does that help im sorry im new to this and im clueless

"Office_Novice" wrote:

Sure, The cool thing about VBA is you can pretty much make it do watever you
want. So; you have a userform with some Check boxes on it and those check
correspond with some textboxes? Perhaps you could share what your trying to
do?

"girlnc16" wrote:

ok its a userform and i would like to check them or deselect them....also is
it possible that when i check a certain box a text box opens where certain
inform can be typed in and filled out?

"Office_Novice" wrote:

Be Glad to help are these check boxes on the excel worksheet itself? or on a
userform?

"girlnc16" wrote:

OK PLEASE HELP
Ive read about the checked boxes but I cant seem to get it right. I have a
exsisting form in excel which has unchecked boxes already i want to be able
to select them and check when and if needed. I got lost at the entering the
macros part and it didnt work could someone pls break it down in easier terms
for me to follow and get it done....Thanks.
Girlnc16