Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to Start a Macro by physically checking a check box?

I have created my first macro (don't laugh) and I want the macro to start
when I check off a check box in the form I made.

How do I do this?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default How to Start a Macro by physically checking a check box?

hi
try this......
Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
Call myfirstmacro
End If
End Sub

change any names if needed.
regards
FSt1

"Mr Imnotabrainsurgeon" wrote:

I have created my first macro (don't laugh) and I want the macro to start
when I check off a check box in the form I made.

How do I do this?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default How to Start a Macro by physically checking a check box?

If you'e written your macro you can right click your checkbox and assign the
code to it (Forms checkbox) then add this as the first line of your sub

Sub YourSub()
If ActiveSheet.CheckBoxes("Check Box 1").Value = xlOff Then Exit Sub
'Your code
End Sub

Mike

"Mr Imnotabrainsurgeon" wrote:

I have created my first macro (don't laugh) and I want the macro to start
when I check off a check box in the form I made.

How do I do this?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,117
Default How to Start a Macro by physically checking a check box?

when you're in design mode, making changes to the userform, double-
click on the checkbox you want to call the macro. this will open the
VB editor & you will see something like:

Private Sub Checkbox1_Click()
*****
End Sub

except there won't be any stars there. where the stars are, that's
where you code goes. if your code is in a module in the project or in
the userform module you simply write:

Call MyCode '<--- change to the name of your code

and it will make that code run.
:)
susan


On Sep 24, 3:18*pm, Mr Imnotabrainsurgeon <Mr
wrote:
I have created my first macro (don't laugh) and I want the macro to start
when I check off a check box in the form I made.

How do I do this?


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 check if a date falls within a range(2 cells: Start/End Dat MarcusMac Excel Worksheet Functions 4 July 30th 08 04:21 PM
macro checking Stan Halls Excel Worksheet Functions 1 December 28th 07 01:48 PM
Checking macro merry_fay Excel Discussion (Misc queries) 4 December 12th 07 04:42 PM
check if the text string start with a specific character September21 New Users to Excel 5 September 22nd 05 03:07 PM
Why does spelling check close Excel when checking spanish? RCP Excel Discussion (Misc queries) 2 December 4th 04 07:37 PM


All times are GMT +1. The time now is 01:31 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"