Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Private Sub Worksheet_Change(ByVal Target As Range)

Have the following code in the referenced module:

If Not (Intersect(Target, Range("A3:A65536")) Is Nothing) Then
Range("a:a").EntireColumn.AutoFit
ActiveSheet.Protect Password:="xxx", DrawingObjects:=True,
Contents:=True, Scenarios:=True, AllowFormattingColumns:=True
ActiveSheet.EnableSelection = xlNoRestrictions
End If

The autofit works fine. But when I copy and paste data into Column A, it
only allows me to paste the data once; if I want to paste the same data into
another part of Column A, I have to go back and copy the data again and then
paste it. It is as if it is clearing the clipboard (which it is not), or
maybe it has to do with the protection (all cells in Column A are unlocked).
Am at my wits end trying to figure out what I'm doing wrong. Can someone
please advise?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Private Sub Worksheet_Change(ByVal Target As Range)

You could try adding

Target.copy

at the end of your code so that you could copy it again.

"Paige" wrote:

Have the following code in the referenced module:

If Not (Intersect(Target, Range("A3:A65536")) Is Nothing) Then
Range("a:a").EntireColumn.AutoFit
ActiveSheet.Protect Password:="xxx", DrawingObjects:=True,
Contents:=True, Scenarios:=True, AllowFormattingColumns:=True
ActiveSheet.EnableSelection = xlNoRestrictions
End If

The autofit works fine. But when I copy and paste data into Column A, it
only allows me to paste the data once; if I want to paste the same data into
another part of Column A, I have to go back and copy the data again and then
paste it. It is as if it is clearing the clipboard (which it is not), or
maybe it has to do with the protection (all cells in Column A are unlocked).
Am at my wits end trying to figure out what I'm doing wrong. Can someone
please advise?

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
Control Toolbox and Private Sub Worksheet_Change(ByVal Target Toppers Excel Discussion (Misc queries) 0 August 17th 07 01:52 AM
Private Sub Worksheet_Change(ByVal Target As Excel.Range) Arturo Excel Programming 5 March 9th 07 04:30 PM
Private Sub Worksheet_Change(ByVal Target As Excel.Range) [email protected] Excel Worksheet Functions 0 December 21st 06 02:13 AM
Private Sub Worksheet_Change(ByVal Target As Range) pd1234321 Excel Programming 5 December 8th 06 04:11 AM
Private Sub Worksheet_Change(ByVal Target As Range) Arturo Excel Programming 1 May 25th 05 03:32 PM


All times are GMT +1. The time now is 01:13 PM.

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"