If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
copying colour from a table cell to another table cell
I have produced a specific colour in a cell, I now want to use it in another
table in the same document, how can I copy the colour? |
#2
|
|||
|
|||
copying colour from a table cell to another table cell
Hi Purplejopeg,
I couldn't find a way other than to record the source color, select the target cells afterwards, and apply the recorded color. Of course, some vba-knowledge is essential. Option Explicit Dim lngColor As Long ' global for module ' ------------------------------- Sub GetColor() lngColor = Selection.Cells(1).Shading.BackgroundPatternColor End Sub ' ------------------------------- Sub SetColor() Selection.Cells.Shading.BackgroundPatternColor = lngColor End Sub You may assign the macros to convenient shortcuts. The value of lngColor might not stay defined forever, depending on what you do between getcolor and setcolor. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Vista Small Business, Office XP |
#3
|
|||
|
|||
copying colour from a table cell to another table cell
Thanks, but I don't have any vba knowledge, guess it is visual basic. I have
managed to find out the colour breakdown so all is not lost, but it is very slow. "Helmut Weber" wrote: Hi Purplejopeg, I couldn't find a way other than to record the source color, select the target cells afterwards, and apply the recorded color. Of course, some vba-knowledge is essential. Option Explicit Dim lngColor As Long ' global for module ' ------------------------------- Sub GetColor() lngColor = Selection.Cells(1).Shading.BackgroundPatternColor End Sub ' ------------------------------- Sub SetColor() Selection.Cells.Shading.BackgroundPatternColor = lngColor End Sub You may assign the macros to convenient shortcuts. The value of lngColor might not stay defined forever, depending on what you do between getcolor and setcolor. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Vista Small Business, Office XP |
#4
|
|||
|
|||
copying colour from a table cell to another table cell
If you've applied the colour once, you can apply it to other cells with F4
(EditRedoOrRepeat). I thought it would be enough to open and close the BordersAndShading dialog with the cursor in the cell you want to "copy" from, to pick up the colour, but that does not seem to work in Word 2003. Regards, Klaus |
#5
|
|||
|
|||
copying colour from a table cell to another table cell
FWIW, it doesn't seem to be working in Word 2007 either. The *borders* can be
picked up by visiting the Borders and Shading dialog, and then pressing F4, though. -- Stefan Blom Microsoft Word MVP "Klaus Linke" wrote: If you've applied the colour once, you can apply it to other cells with F4 (EditRedoOrRepeat). I thought it would be enough to open and close the BordersAndShading dialog with the cursor in the cell you want to "copy" from, to pick up the colour, but that does not seem to work in Word 2003. Regards, Klaus |
Thread Tools | |
Display Modes | |
|
|