VBA Control Checkbox

  • Thread starter Thread starter Tommy
  • Start date Start date
T

Tommy

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
 
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
 
Back
Top