Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can I copy a cell (via Ctl-C) and then click on a destination, whether a
single cell or multiple cells - then activate a macro that will copy the comments, the border and the color (from the source) to the destination cell(s) without disturbing the value that is already in the destination cell(s)? Thks in advance... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should do the trick
Sub CopyFormatComents() 'Assumes that range has been copied If Application.CutCopyMode = xlCopy Then Selection.PasteSpecial Paste:=xlPasteComments Selection.PasteSpecial Paste:=xlFormats Application.CutCopyMode = False Else: MsgBox "You must copy a cell First" End If End Sub Regards Peter -----Original Message----- Can I copy a cell (via Ctl-C) and then click on a destination, whether a single cell or multiple cells - then activate a macro that will copy the comments, the border and the color (from the source) to the destination cell(s) without disturbing the value that is already in the destination cell(s)? Thks in advance... . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I entered your Sub() but when I run it (after first doing a Copy, the
destination select - a single cell) ----- I get: "You must copy a cell First" OK We're almost there... Thanks, "Peter Atherton" wrote in message ... This should do the trick Sub CopyFormatComents() 'Assumes that range has been copied If Application.CutCopyMode = xlCopy Then Selection.PasteSpecial Paste:=xlPasteComments Selection.PasteSpecial Paste:=xlFormats Application.CutCopyMode = False Else: MsgBox "You must copy a cell First" End If End Sub Regards Peter -----Original Message----- Can I copy a cell (via Ctl-C) and then click on a destination, whether a single cell or multiple cells - then activate a macro that will copy the comments, the border and the color (from the source) to the destination cell(s) without disturbing the value that is already in the destination cell(s)? Thks in advance... . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Peter, a quick note.... When I do a Step-through (with both windows on
screen) it works; but with my VBE closed, I'm getting the You must copy a cell First" OK Tks, JMay "JMay" wrote in message news:6JUub.28083$HD3.27416@lakeread06... I entered your Sub() but when I run it (after first doing a Copy, the destination select - a single cell) ----- I get: "You must copy a cell First" OK We're almost there... Thanks, "Peter Atherton" wrote in message ... This should do the trick Sub CopyFormatComents() 'Assumes that range has been copied If Application.CutCopyMode = xlCopy Then Selection.PasteSpecial Paste:=xlPasteComments Selection.PasteSpecial Paste:=xlFormats Application.CutCopyMode = False Else: MsgBox "You must copy a cell First" End If End Sub Regards Peter -----Original Message----- Can I copy a cell (via Ctl-C) and then click on a destination, whether a single cell or multiple cells - then activate a macro that will copy the comments, the border and the color (from the source) to the destination cell(s) without disturbing the value that is already in the destination cell(s)? Thks in advance... . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've tried this again and it works OK for me. The message
is only to tell the user that he has not copied anything to the clipboard before running the macro. Copy the cell then select the destination cell and then run the macro Regards Peter -----Original Message----- I entered your Sub() but when I run it (after first doing a Copy, the destination select - a single cell) ----- I get: "You must copy a cell First" OK We're almost there... Thanks, "Peter Atherton" wrote in message ... This should do the trick Sub CopyFormatComents() 'Assumes that range has been copied If Application.CutCopyMode = xlCopy Then Selection.PasteSpecial Paste:=xlPasteComments Selection.PasteSpecial Paste:=xlFormats Application.CutCopyMode = False Else: MsgBox "You must copy a cell First" End If End Sub Regards Peter -----Original Message----- Can I copy a cell (via Ctl-C) and then click on a destination, whether a single cell or multiple cells - then activate a macro that will copy the comments, the border and the color (from the source) to the destination cell(s) without disturbing the value that is already in the destination cell(s)? Thks in advance... . . |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When you choose ToolsMacroMacros, CutCopyMode changes to False.
To run the macro, you could add a toolbar button, or assign a keyboard shortcut. JMay wrote: I entered your Sub() but when I run it (after first doing a Copy, the destination select - a single cell) ----- I get: "You must copy a cell First" OK We're almost there... Thanks, "Peter Atherton" wrote in message ... This should do the trick Sub CopyFormatComents() 'Assumes that range has been copied If Application.CutCopyMode = xlCopy Then Selection.PasteSpecial Paste:=xlPasteComments Selection.PasteSpecial Paste:=xlFormats Application.CutCopyMode = False Else: MsgBox "You must copy a cell First" End If End Sub Regards Peter -----Original Message----- Can I copy a cell (via Ctl-C) and then click on a destination, whether a single cell or multiple cells - then activate a macro that will copy the comments, the border and the color (from the source) to the destination cell(s) without disturbing the value that is already in the destination cell(s)? Thks in advance... . -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That was the "prob"- Thanks to you both Peter and Debra
It works fine, now.. Most helpful.. JMay "Debra Dalgleish" wrote in message ... When you choose ToolsMacroMacros, CutCopyMode changes to False. To run the macro, you could add a toolbar button, or assign a keyboard shortcut. JMay wrote: I entered your Sub() but when I run it (after first doing a Copy, the destination select - a single cell) ----- I get: "You must copy a cell First" OK We're almost there... Thanks, "Peter Atherton" wrote in message ... This should do the trick Sub CopyFormatComents() 'Assumes that range has been copied If Application.CutCopyMode = xlCopy Then Selection.PasteSpecial Paste:=xlPasteComments Selection.PasteSpecial Paste:=xlFormats Application.CutCopyMode = False Else: MsgBox "You must copy a cell First" End If End Sub Regards Peter -----Original Message----- Can I copy a cell (via Ctl-C) and then click on a destination, whether a single cell or multiple cells - then activate a macro that will copy the comments, the border and the color (from the source) to the destination cell(s) without disturbing the value that is already in the destination cell(s)? Thks in advance... . -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Exel 97 ColorIndex | Excel Discussion (Misc queries) | |||
ColorIndex | Excel Worksheet Functions | |||
VBA ColorIndex Formatting | Excel Discussion (Misc queries) | |||
colorindex | Excel Discussion (Misc queries) | |||
Font and Fill ColorIndex | Excel Programming |