Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default What of these commands ruin my copy - paste operation between workbooks?

When I copy a cell in one workbook and want to paste it in an other, I
can't. I suspect one of these commands ruin the operation - any suggestions?

Worksheet_Activate()
ActiveSheet.Unprotect
ActiveSheet.Protect AllowFormattingCells:=False
ActiveSheet.EnableSelection = xlUnlockedCells


Mindkiller No 2
I try to keep the format i one column, despite past operations. Conditional
formatting should be the solution, but I don't succeed. I have a little
extra moment - It sholud be one format when the cell in the column to the
left has a "K" as value, and an other format if it contains value "I".

AND it should keep these formats when copy - paste beteween workbooks.

Any sugestions?

/Regards


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default What of these commands ruin my copy - paste operation between workbooks?

As to the copying problem, when you do a Copy, Excel is in "code mode".
However a great many actions take Excel out of copy mode, including
apparently some of the ones in your macro. So you should do these actions
before you do the actual copy. Ideally the copy should be followed
immediately by a paste, however you should be able to switch to another
workbook/sheet active before you paste without exiting copy mode.

--
Jim Rech
Excel MVP
wrote in message
...
| When I copy a cell in one workbook and want to paste it in an other, I
| can't. I suspect one of these commands ruin the operation - any
suggestions?
|
| Worksheet_Activate()
| ActiveSheet.Unprotect
| ActiveSheet.Protect AllowFormattingCells:=False
| ActiveSheet.EnableSelection = xlUnlockedCells
|
|
| Mindkiller No 2
| I try to keep the format i one column, despite past operations.
Conditional
| formatting should be the solution, but I don't succeed. I have a little
| extra moment - It sholud be one format when the cell in the column to the
| left has a "K" as value, and an other format if it contains value "I".
|
| AND it should keep these formats when copy - paste beteween workbooks.
|
| Any sugestions?
|
| /Regards
|
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default What of these commands ruin my copy - paste operation betweenworkbooks?

Maybe this'll give you an idea for #2:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

Dim myFormulas As Variant
Dim myRng As Range

Set myRng = Me.Range("b:b")

If Intersect(myRng, Target) Is Nothing Then Exit Sub

myFormulas = Target.Formula 'save the formulas
With Application
.EnableEvents = False
.Undo 'put them back to what they were!
End With
If Union(myRng, Target).Address < myRng.Address Then
MsgBox "Column B cannot be changed with any other column!"
ElseIf Target.Areas.Count 1 Then
MsgBox "Please just one area at a time!"
Else
Target.Formula = myFormulas 'just put the formulas back
End If

errHandler:
Application.EnableEvents = True

End Sub



wrote:

When I copy a cell in one workbook and want to paste it in an other, I
can't. I suspect one of these commands ruin the operation - any suggestions?

Worksheet_Activate()
ActiveSheet.Unprotect
ActiveSheet.Protect AllowFormattingCells:=False
ActiveSheet.EnableSelection = xlUnlockedCells

Mindkiller No 2
I try to keep the format i one column, despite past operations. Conditional
formatting should be the solution, but I don't succeed. I have a little
extra moment - It sholud be one format when the cell in the column to the
left has a "K" as value, and an other format if it contains value "I".

AND it should keep these formats when copy - paste beteween workbooks.

Any sugestions?

/Regards


--

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
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Copy and paste between workbooks keith Excel Discussion (Misc queries) 2 February 18th 09 04:46 PM
"ignoring" hidden cells in a copy/paste operation gvm Excel Discussion (Misc queries) 2 March 22nd 07 10:38 PM
My cut, copy and paste commands are not working when I right clic. Cosmicblu Excel Discussion (Misc queries) 0 April 13th 05 08:01 PM
Copy and Paste Between Workbooks Lee Excel Programming 2 November 13th 03 08:08 PM


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