Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Control Checkbox
I am writing an application by VBA with Access. In the
program, I need to get info from Access DB and put into an Excel file. For normal cells, it's ok to put text in it. But there are some check boxs on the Excel sheet, how do i control checkbox value inside VBA code? Thanks! Tommy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Control Checkbox
Hi Tommy
Me.CheckBox1.Value = False Or Me.CheckBox1.Value = True -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Tommy" wrote in message ... I am writing an application by VBA with Access. In the program, I need to get info from Access DB and put into an Excel file. For normal cells, it's ok to put text in it. But there are some check boxs on the Excel sheet, how do i control checkbox value inside VBA code? Thanks! Tommy |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Control Checkbox
Try worksheet("Sheet1").checkbox1.value = false...
where you substitute your sheet's name for Sheet1. I understand the use of me.checkbox1 would apply to say code that's running from a form that has checkbox1 on the form... kind of like thisworkbook for forms. or to paste from the help file (which makes me think my personal definition was wrong) The Me keyword behaves like an implicitly declared variable. It is automatically available to every procedure in a class module. When a class can have more than one instance, Me provides a way to refer to the specific instance of the class where the code is executing. Using Me is particularly useful for passing information about the currently executing instance of a class to a procedure in another module. For example, suppose you have the following procedure in a module: Sub ChangeFormColor(FormName As Form) FormName.BackColor = RGB(Rnd * 256, Rnd * 256, Rnd * 256) End Sub You can call this procedure and pass the current instance of the Form class as an argument using the following statement: ChangeFormColor Me "tommy" wrote in message ... The Excel is created by somebody else, when I open the Excel I can see the name like "check box 1".... for each check box. In VB editor, I type me. then the drop down list does not show those check box names, when i use the name, it get compiled error. Thanks for you help! Tommy -----Original Message----- Hi Tommy Me.CheckBox1.Value = False Or Me.CheckBox1.Value = True -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Tommy" wrote in message ... I am writing an application by VBA with Access. In the program, I need to get info from Access DB and put into an Excel file. For normal cells, it's ok to put text in it. But there are some check boxs on the Excel sheet, how do i control checkbox value inside VBA code? Thanks! Tommy . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Resizing an activex checkbox control | Excel Worksheet Functions | |||
problem with checkbox control | Excel Worksheet Functions | |||
HOW DO I GIVE A CONTROL TOOLBOX CHECKBOX A VALUE IN EXCEL? | Excel Worksheet Functions | |||
how do I protect a worksheet and still use a checkbox control | Excel Worksheet Functions | |||
resize control checkbox with cell | Excel Discussion (Misc queries) |