Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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
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
Resizing an activex checkbox control Blue Max Excel Worksheet Functions 2 December 13th 08 10:29 PM
problem with checkbox control Giselle Excel Worksheet Functions 1 March 31st 06 12:57 PM
HOW DO I GIVE A CONTROL TOOLBOX CHECKBOX A VALUE IN EXCEL? Paula Excel Worksheet Functions 0 March 6th 06 04:31 PM
how do I protect a worksheet and still use a checkbox control JayS Excel Worksheet Functions 4 September 8th 05 07:36 AM
resize control checkbox with cell packat Excel Discussion (Misc queries) 2 December 27th 04 01:16 PM


All times are GMT +1. The time now is 05:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"