View Single Post
  #6   Report Post  
Posted to microsoft.public.word.tables
Helmut Weber Helmut Weber is offline
external usenet poster
 
Posts: 139
Default How do I copy table cell colors.

Hi MadMeg,

open the VBA-editor, [Alt F11],
from the menu bar in the editor, choose
insert module
copy the macro code from the posting
into the module
save [Ctrl S]
quit the VBA-editor, [Ctrl Q]

Method 1:
From the the menu bar in Word, choose
tools, customize
commands,
in the left listbox select
macros
click the command button
keybord
near to the lower right hand corner of the form
in the left listbox select
macros
in the right listbox select the macro
....
You may now assign a shortcut to the selected macro.

Method 2:
From the from the menu bar in Word, choose
tools, customize
commands,
in the left listbox select
macros
in the right listbox select the macro.
Drag the macro into a command bar of your like:

Hardly possible to describe every detail.
I very likely missed one step or another.

See in addition:
http://word.mvps.org/faqs/macrosvba/CreateAMacro.htm
http://word.mvps.org/faqs/macrosvba/UsingRecorder.htm
http://word.mvps.org/faqs/macrosvba/...csIn15Mins.htm

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"










Thank you Helmut. Unfortunatley I don't know how to write Macros. Maybe
this is the time to learn. Do you have any more words of wisdom on how to do
this?

Thanks from Toronto Canada!!

MM
"Helmut Weber" wrote:

Hi MadMeg,

want a macro solution, then like this:

Option Explicit
Dim lCnt As Long
' -------------------------
Sub CopyColor()
lCnt = selection.Cells(1).Shading.BackgroundPatternColor
End Sub
' -------------------------
Sub PasteColor()
selection.Cells(1).Shading.BackgroundPatternColor = lCnt
End Sub

With the usual drawbacks of workarounds, of course,
above all with the drawbacks of a global variable.

It's only to show a possible way.

You could store the color number in the clipboard,
with still other drawbacks.

Or in a document variable.

So many ways.


--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"