Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Inserting Rows with the change event active

Is there a similar statement as "If Application.CutCopyMode 0 Then
Exit Sub" that I can use in a worksheet change event to allow the
inserting of rows? (the program freezes)

I pressume that the problem occurs due to the fact that the program
'finds it difficult' to establish the TARGET cell. So maybe a way to
eliminate this parameter??

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Inserting Rows with the change event active

Hi KobusD,

It might help if you posted the problematic code.


---
Regards,
Norman



"KobusD" wrote in message
ups.com...
Is there a similar statement as "If Application.CutCopyMode 0 Then
Exit Sub" that I can use in a worksheet change event to allow the
inserting of rows? (the program freezes)

I pressume that the problem occurs due to the fact that the program
'finds it difficult' to establish the TARGET cell. So maybe a way to
eliminate this parameter??



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Inserting Rows with the change event active

Thanks for the reply, Norman. Here is the code:

Private Sub Worksheet_Change(ByVal Target As Range)

If Application.CutCopyMode 0 Then Exit Sub

'Turn calculation and screen updating off whilst the following code
executes
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False

'Unprotect the worksheet and disable the selection of locked cells
Worksheets("Output").Unprotect Password:="xxxxx"
Worksheets("Output(budgets)").Unprotect Password:="xxxxxx"

Worksheets("Budgets").CompileButt.BackColor = RGB(255, 0, 0)
Worksheets("Budgets").CompileButt.Caption = "Needs a Compile!"
Worksheets("Budgets").CompileButt.PrintObject = True

Worksheets("Output").Range("A2").Value = "A compile is outstanding!"
Worksheets("Output(budgets)").Range("F2").Value = "A compile is
outstanding!"

'Protect the worksheet and disable the selection of locked cells
Worksheets("Output").Protect Password:="xxxxx"
Worksheets("Output").EnableSelection = xlUnlockedCells
Worksheets("Output(budgets)").Protect Password:="xxxxxx"
Worksheets("Output(budgets)").EnableSelection = xlUnlockedCells

End Sub

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 can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
Can't hide/unhide rows under worksheet change event? Don Wiss Excel Programming 6 May 24th 05 11:57 PM
Inserting Rows during a SheetChange event Nirmal Singh Excel Programming 4 January 7th 05 01:24 PM
Worksheet is no longer the active sheet Event Todd Huttenstine Excel Programming 3 May 21st 04 09:16 PM


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