Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Execute a macro automatically when checkbox is clicked

Hi!

I have a macro that I need to be executed automatically when a checkbox
called checkbox1 is clicked.

I tried with a simple macro like

Private Sub CheckBox1_Click()
If CheckBoxes("CheckBox1").Value = 1 Then
Range("a4").Value = 12
End If
End Sub

that is located at the corresponding sheet. The macro works fine when I
executed step by step, but is not running automatically when I click on
CheckBox1

Any idea?

Thanks,

Ezequiel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Execute a macro automatically when checkbox is clicked

Private Sub CheckBox1_Change()
If CheckBox1.Value = True Then
Range("a4").Value = 12
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Ezequiel" wrote:

Hi!

I have a macro that I need to be executed automatically when a checkbox
called checkbox1 is clicked.

I tried with a simple macro like

Private Sub CheckBox1_Click()
If CheckBoxes("CheckBox1").Value = 1 Then
Range("a4").Value = 12
End If
End Sub

that is located at the corresponding sheet. The macro works fine when I
executed step by step, but is not running automatically when I click on
CheckBox1

Any idea?

Thanks,

Ezequiel

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Execute a macro automatically when checkbox is clicked

Hi! Is not working:

1. When I click on the checkbox1 in the spreadsheet nothing happens and
2. If I execute the macro step by step, in the "If CheckBox1.Value = True
Then" part I got an error saying : "Run-time error '424': Object required"

Thanks,

Ezequiel

"Jacob Skaria" wrote:

Private Sub CheckBox1_Change()
If CheckBox1.Value = True Then
Range("a4").Value = 12
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Ezequiel" wrote:

Hi!

I have a macro that I need to be executed automatically when a checkbox
called checkbox1 is clicked.

I tried with a simple macro like

Private Sub CheckBox1_Click()
If CheckBoxes("CheckBox1").Value = 1 Then
Range("a4").Value = 12
End If
End Sub

that is located at the corresponding sheet. The macro works fine when I
executed step by step, but is not running automatically when I click on
CheckBox1

Any idea?

Thanks,

Ezequiel

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Execute a macro automatically when checkbox is clicked

check that the code is on the sheet's code page
check that you're using the ActiveX control
check that the check box change event does fire the code

check that application.enableevents = True



"Ezequiel" wrote in message
...
Hi! Is not working:

1. When I click on the checkbox1 in the spreadsheet nothing happens and
2. If I execute the macro step by step, in the "If CheckBox1.Value = True
Then" part I got an error saying : "Run-time error '424': Object required"

Thanks,

Ezequiel

"Jacob Skaria" wrote:

Private Sub CheckBox1_Change()
If CheckBox1.Value = True Then
Range("a4").Value = 12
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Ezequiel" wrote:

Hi!

I have a macro that I need to be executed automatically when a checkbox
called checkbox1 is clicked.

I tried with a simple macro like

Private Sub CheckBox1_Click()
If CheckBoxes("CheckBox1").Value = 1 Then
Range("a4").Value = 12
End If
End Sub

that is located at the corresponding sheet. The macro works fine when I
executed step by step, but is not running automatically when I click on
CheckBox1

Any idea?

Thanks,

Ezequiel


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
Automatically Execute Excel Macro at 6:00 am scott[_11_] Excel Programming 2 November 7th 07 05:12 PM
how to execute a macro automatically Roger[_22_] Excel Programming 2 July 3rd 06 10:42 AM
how to execute a macro assigned to a checkbox in vba [email protected] Excel Programming 4 June 21st 06 09:31 AM
Execute Macro automatically after hyperlink Bill Elerding Excel Discussion (Misc queries) 13 May 5th 05 01:01 AM
Automatically execute a macro Harry[_6_] Excel Programming 2 October 15th 04 12:37 PM


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