Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste doesn't work
Hello,
I'd created the following macro in Thisworkbook. But because of this, the paste function doesn't work any more. Can someone help? Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) [a3:iq5000].Interior.ColorIndex = 0 If Target.Row 2 Then T = "J" & Target.Row & ":K" & Target.Row Range(T).Interior.ColorIndex = 6 End If End Sub Best Regards Wen |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste doesn't work
A lot of macros kill the Edit|Undo feature. And lots of macros kill the
cutcopymode flag. Maybe you could have your own version of cut/copy and paste. Add a "application.enableevents = false" before selecting your "to" range. And then turn it back on. But then you'd have to write the equivalent of the Workbook_SheetSelectionChange code. And this might not be useful to you, but I could do this: Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _ ByVal Target As Range) If Application.CutCopyMode < False Then Exit Sub ''''rest of sub end sub and then the copy|paste still worked. But that did kill the rest of your sub. ==== And if you're copying while you're developing, you can temporarily suspend the events by going into the vbe and hitting ctrl-G (to see the immediate window) and typing: application.EnableEvents = False do your development and turn it back on for testing: application.EnableEvents = True Wen wrote: Hello, I'd created the following macro in Thisworkbook. But because of this, the paste function doesn't work any more. Can someone help? Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) [a3:iq5000].Interior.ColorIndex = 0 If Target.Row 2 Then T = "J" & Target.Row & ":K" & Target.Row Range(T).Interior.ColorIndex = 6 End If End Sub Best Regards Wen -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste doesn't work
Hello Dave,
"If Application.CutCopyMode < False Then Exit Sub" is exact what I'm looking for. Thank you very much. The best regards Wen Dave Peterson wrote in message ... A lot of macros kill the Edit|Undo feature. And lots of macros kill the cutcopymode flag. Maybe you could have your own version of cut/copy and paste. Add a "application.enableevents = false" before selecting your "to" range. And then turn it back on. But then you'd have to write the equivalent of the Workbook_SheetSelectionChange code. And this might not be useful to you, but I could do this: Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _ ByVal Target As Range) If Application.CutCopyMode < False Then Exit Sub ''''rest of sub end sub and then the copy|paste still worked. But that did kill the rest of your sub. ==== And if you're copying while you're developing, you can temporarily suspend the events by going into the vbe and hitting ctrl-G (to see the immediate window) and typing: application.EnableEvents = False do your development and turn it back on for testing: application.EnableEvents = True Wen wrote: Hello, I'd created the following macro in Thisworkbook. But because of this, the paste function doesn't work any more. Can someone help? Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) [a3:iq5000].Interior.ColorIndex = 0 If Target.Row 2 Then T = "J" & Target.Row & ":K" & Target.Row Range(T).Interior.ColorIndex = 6 End If End Sub Best Regards Wen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What caused my paste function not to work? | Excel Worksheet Functions | |||
How to paste a bitmap-excel paste doesn't work... | Excel Discussion (Misc queries) | |||
PASTE DOESNT WORK | Excel Worksheet Functions | |||
EXCEL PASTE DOES NOT CHANGE DATA - PASTE DOESN'T WORK! | Excel Worksheet Functions | |||
Paste function in Excel doesn't work | Excel Discussion (Misc queries) |