Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Excel events appearing unexpectedly


OssieMac,

That suggestion worked great and allowed me to insert rows in the middle of
the range without invoking the combobox event. Thank you.

"OssieMac" wrote:

Hi Phyllis,

I suspected something similar that was causing the event to fire and hense
my reason for asking to see the code. However, try turning off events while
the code is making the changes that are causing the problem.

Private Sub Worksheet_Change(ByVal Target As Range)
'Insert following prior to code causing event
'to fire
On Error GoTo ReEnableEvents
Application.EnableEvents = False

'Your other code in here


'Insert following after your other code.
ReEnableEvents:
Application.EnableEvents = True
End Sub

If you use the above and for any reason the code stops before reenabling the
events then the events remain turned off until you either turn them back on
with code or restart excel. Therefore, insert the following sub somewhere and
just place the cursor in the sub and press F5.

Sub Re_Enable_Events()
Application.EnableEvents = True
End Sub

--
Regards,

OssieMac


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
Excel 2007 charts resizing unexpectedly Iain Inglis Charts and Charting in Excel 0 December 4th 08 11:02 PM
Can you reproduce Excel unexpectedly closing? Jerry W. Lewis Excel Discussion (Misc queries) 2 March 16th 08 01:53 PM
Excel Closes Unexpectedly Lisa E. Excel Discussion (Misc queries) 3 December 12th 07 04:33 PM
Excel quits unexpectedly Simon Brown Excel Worksheet Functions 1 May 4th 07 11:36 PM
Excel VBA window appear unexpectedly.... Really annoying TKovacs Excel Programming 0 May 18th 06 07:33 PM


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