LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Event macro firing twice

Excel 2002, WinXP
Tom Ogilvy, Vasant, and Greg Wilson were very helpful with setting up my
code. The objective was to determine which one of many checkboxes was
clicked on and its value. I am having one problem with it and I think it's
due to some code that I added.
The event macro, in a class module, is:
Public WithEvents CheckBoxGroup As MSForms.CheckBox
Private Sub CheckBoxGroup_Click()
Set i = ActiveSheet.Range(CheckBoxGroup.LinkedCell)
MsgBox CheckBoxGroup.Name & " clicked"
Call CopyData2
End Sub

The line above that starts with "Set i = " is mine. I want to set "i" to
the cell that is linked to the checkbox that was clicked on. My final
purpose is to access the cell to the right of that linked cell.
I reduced my code in the CopyData2 macro to just a few lines to demonstrate
my problem. The CopyData2 macro is:
Sub CopyData2()
Set Dest = Sheets("Results").Range("D1")
i.Offset(, 1).Copy
Dest.PasteSpecial xlPasteValues
End Sub

My problem is that the event macro fires twice when the checkbox is clicked
to True once. This of course causes the CopyData2 macro to execute twice as
well.
Where did I go wrong? Thanks for your help. Otto


 
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
Workbook_Open event not firing 0013 Excel Programming 4 May 24th 05 09:53 PM
Event sometimes stops firing? HotRod Excel Programming 7 May 5th 05 12:20 AM
Code for App level event (not firing) Chris W[_3_] Excel Programming 2 February 28th 05 02:57 AM
Worksheet change event not firing Wexler Excel Programming 11 October 25th 04 09:45 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


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

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"