Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default PasteSpecial - Comments and ColorIndex

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default PasteSpecial - Comments and ColorIndex

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default PasteSpecial - Comments and ColorIndex

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default PasteSpecial - Comments and ColorIndex

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default PasteSpecial - Comments and ColorIndex

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default PasteSpecial - Comments and ColorIndex

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default PasteSpecial - Comments and ColorIndex

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
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
Exel 97 ColorIndex Shawn Excel Discussion (Misc queries) 1 October 2nd 09 06:03 PM
ColorIndex skat Excel Worksheet Functions 5 June 5th 06 02:42 AM
VBA ColorIndex Formatting [email protected] Excel Discussion (Misc queries) 5 February 20th 06 03:38 PM
colorindex Nell Fahey Excel Discussion (Misc queries) 3 April 28th 05 07:06 PM
Font and Fill ColorIndex Frank[_19_] Excel Programming 3 October 31st 03 01:52 PM


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