View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Earl Kiosterud Earl Kiosterud is offline
external usenet poster
 
Posts: 611
Default Retain formatting of Excel sheet when copying data into it

Carmela,

If the paste special works as you want, then you could have a macro do the paste special,
instead of using paste or paste special. Other'n that, the regular paste will continue to
overwrite the cell formatting with that of the copied data.

For the macro solution, copy/paste this into a module in the workbook (or into Personal.xls
or any other workbook) (which must be open while you want to use it):

Sub PasteSpecialText()
ActiveSheet.PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:= _
False
End Sub

Using Tools - Macro - Macros, you can assign a shortcut key to facilitate doing the paste
special, like Ctrl-Shift-q, or something like that. Magic

--
Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
wrote in message
...
Thanks for replying Earl. Yes this works. However, actually there is
already a worksheet I have that someone created but is no longer with
the company into which when I copy data, the original formatting of
the data is lost. That is what I am trying to replicate (without
having to remember to use Paste Special). Any ideas? I can e-mail the
worksheet to anyone interested if needed. Thanks so much.