#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default checkbox

how do use write code so that a checkbox is selected when the program begins?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default checkbox

Assuming that it is a Forms checkbox

Private Sub Workbook_Open()
Worksheets("Sheet1").CheckBoxes("Check Box 2").Value = 1
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"april27" wrote in message
...
how do use write code so that a checkbox is selected when the program

begins?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default checkbox

Hi Apil27,

Assuming that the checkbox is on a userform, as might be implied by some of
your earlier posts, try:

'=============
Private Sub UserForm_Initialize()
Me.CheckBox1.SetFocus
End Sub
'<<=============


---
Regards,
Norman


"april27" wrote in message
...
how do use write code so that a checkbox is selected when the program
begins?



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
How to have Checkbox A uncheck with checked Checkbox B Texas Aggie Excel Discussion (Misc queries) 3 July 20th 07 10:58 PM
How do I link one checkbox to update another checkbox? Mike Excel Programming 3 April 28th 06 02:22 AM
checkbox on form reset from checkbox on sheet raw[_12_] Excel Programming 1 December 3rd 05 05:08 AM
Checkbox!! Oppy Excel Discussion (Misc queries) 2 October 14th 05 05:28 PM
checkbox Paul P Excel Programming 0 September 10th 03 08:56 PM


All times are GMT +1. The time now is 11:52 PM.

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

About Us

"It's about Microsoft Excel"