In this article, we will offer you five methods to quickly apply the fill color of a table cell to the whole row, column or table.
You might notice that when you do copy in a table cell in Word, you get only the cell content but never the fill color. Therefore, we want to show you five workarounds to address this issue.
Method 1: Manually Get the RGB Value of Table Cell
- First of all, select the cell whose fill color you need to get.
- Next click “Design” tab.
- Find the command below “Shading” and click on the drop-down button on that command.
- On the menu choose “Borders and Shading” to open the same name dialog box.
- Next in the box open, click “Shading” tab.
- Go to “Fill” field and click on the drop-down button.
- And select “More Colors” to open “Colors” box.
- Choose “RGB” for the “Color model” field. Get the RGB value below.
- Then close all boxes and put cursor inside target cell. Or you can select multiple cells, rows, columns or even the entire table.
- And click drop-down button on “Shading” command to select “More Colors”.
- Enter the RGB value under “Custom” tab and click “OK”.
Method 2: Open “Reveal Formatting” Pane
The idea is similar that is to get RGB value and then apply it to target cells, rows, columns, or entire table.
- Firstly, place insertion pointer inside the filled cell.
- Next press “Shift+ F1” to open the “Reveal Formatting” pane. And you shall be able to see the RGB value of the cell under “Shading” section.
- Follow step 9 to 11 in method 1.
Method 3: Apply Fill Color of One Cell to the Whole Table via VBA
As the subtitle suggest, here is the way to unite the whole table in one color.
- To begin with, position insertion pointer inside a colored cell.
- Press “Alt+ F11” to trigger VBA editor.
- Next click “Normal” project and click “Insert” tab.
- Then choose “Module” on that menu.
- Open it by double click.
- And paste following codes there:
Sub ApplyColorOfOneCellToEntireTable() Dim nRowIndex As Integer Dim nColumnIndex As Integer Dim nCellForeColor As Long Dim nCellBackColor As Long If Selection.Information(wdWithInTable) = True Then nRowIndex = Selection.Cells(1).RowIndex nColumnIndex = Selection.Cells(1).ColumnIndex Else MsgBox ("Please put your cursor inside a cell.") Exit Sub End If With Selection.Tables(1) nCellBackColor = .Cell(nRowIndex, nColumnIndex).Shading.BackgroundPatternColor nCellForeColor = .Cell(nRowIndex, nColumnIndex).Shading.ForegroundPatternColor .Shading.BackgroundPatternColor = nCellBackColor .Shading.ForegroundPatternColor = nCellForeColor End With End Sub
- Lastly, click “Run” or hit “F5”.
Method 4: Apply Fill Color of One Cell to the Whole Row via VBA
- At first, put cursor inside a cell.
- Next install and run a macro following exactly the same steps in method 3.
- Next replace above codes with these:
Sub ApplyColorOfOneCellToEntireRow() Dim nRowIndex As Integer Dim nCellForeColor As Long Dim nCellBackColor As Long If Selection.Information(wdWithInTable) = True Then nRowIndex = Selection.Cells(1).RowIndex nCellBackColor = Selection.Cells(1).Shading.BackgroundPatternColor nCellForeColor = Selection.Cells(1).Shading.ForegroundPatternColor Else MsgBox ("Please put your cursor inside a cell.") Exit Sub End If With Selection.Tables(1).Rows(nRowIndex).Shading .BackgroundPatternColor = nCellBackColor .ForegroundPatternColor = nCellForeColor End With End Sub
Method 5: Apply Fill Color of One Cell to the Whole Column via VBA
- Likely, put cursor inside a cell first.
- Then install and run a macro properly.
- Replace the macro with this one:
Sub ApplyColorOfOneCellToEntireColumn() Dim nColumnIndex As Integer Dim nCellForeColor As Long Dim nCellBackColor As Long If Selection.Information(wdWithInTable) = True Then nColumnIndex = Selection.Cells(1).ColumnIndex nCellBackColor = Selection.Cells(1).Shading.BackgroundPatternColor nCellForeColor = Selection.Cells(1).Shading.ForegroundPatternColor Else MsgBox ("Please put your cursor inside a cell.") Exit Sub End If With Selection.Tables(1).Columns(nColumnIndex).Shading .BackgroundPatternColor = nCellBackColor .ForegroundPatternColor = nCellForeColor End With End Sub
Handle Word Issues
There are and will always be problems in the process of using Word. So it’s quite necessary to learn the right trick to deal with all these annoying issues. One of the measures you must take is to get hold of a Word fix tool in advance. Then you won’t be panic once a document corrupts.
Author Introduction:
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including recover excel and pdf repair software products. For more information visit www.datanumen.com
Leave a Reply