Check Boxes

G

girlnc16

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
 
G

girlnc16

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?
 
O

Office_Novice

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?
 
G

girlnc16

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
 
O

Office_Novice

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
 
G

girlnc16

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???
 
O

Office_Novice

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.
 
G

girlnc16

ok i did all that but im getting the feeling that my document in excel might
not be a userform b/c when i went into the vb they are listed as excel sheets
under excel objects......after i did what u said am i supposed to be able to
go into the word and select the box now ? cuz that isnt working....
 
G

girlnc16

ok i could use this for my citizen info....after i check the box i need
something like this to come up to input the citizens info into.
 
O

Office_Novice

I guess then you Checkbox is on a Spreadsheet? We can work that too.
From the VBE goto
Insert--> UserForm that will create a useform it should also show th toolbox.
 
O

Office_Novice

Sorry i got off track
To answear your original post do the following:
1) open Excel
2)View-->ToolBars-->Control ToolBox
3)Create your CheckBox
4)On the controltoolbox toolbar the first button
from the left should be "Design Mode" Use this
to allow you to check and uncheck your check box
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top