Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default offset command protected

Hi

I am currently using a macro that allows me to insert a row preserving
formulas by a doubleclick.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True 'Eliminate Edit status due to doubleclick
Target.Offset(1).EntireRow.Insert
Target.EntireRow.Copy Target.Offset(1).EntireRow
On Error Resume Next
Target.Offset(1).EntireRow.SpecialCells(xlConstant s).ClearContents
On Error GoTo 0
End Sub

Reference: David McRitchie

My problem is when i protect my worksheet, this macro fails to operate when
it gets to the "Target.EntireRow.Copy Target.Offset(1).EntireRow" part.

When protecting i enabled all exceptions and still doesnt work. Is there a
way around this. Sorry, I am quite new at all this. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default offset command protected

Maybe you can just add a couple of lines:

Private Sub Worksheet_BeforeDoubleClick(...

me.unprotect password:="whatever"

'your existing code

me.protect password:="whatever"

end sub

cjupiter wrote:

Hi

I am currently using a macro that allows me to insert a row preserving
formulas by a doubleclick.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True 'Eliminate Edit status due to doubleclick
Target.Offset(1).EntireRow.Insert
Target.EntireRow.Copy Target.Offset(1).EntireRow
On Error Resume Next
Target.Offset(1).EntireRow.SpecialCells(xlConstant s).ClearContents
On Error GoTo 0
End Sub

Reference: David McRitchie

My problem is when i protect my worksheet, this macro fails to operate when
it gets to the "Target.EntireRow.Copy Target.Offset(1).EntireRow" part.

When protecting i enabled all exceptions and still doesnt work. Is there a
way around this. Sorry, I am quite new at all this. Thanks


--

Dave Peterson
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
Worksheets with OFFSET command always ask if I want to SAVE Jolly good Delaware lad Excel Worksheet Functions 2 April 1st 07 08:40 PM
OFFSET command and linked documents DawnS Excel Worksheet Functions 2 June 15th 05 09:31 AM
QUESTION with Match command and OFFSET alomega Excel Programming 2 February 9th 05 08:11 PM
Keyboard command different when protected bw Excel Programming 3 September 3rd 04 04:08 PM
Deleting some cells in a row using command button and offset Marvin Excel Programming 3 April 6th 04 02:36 AM


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