5 Methods to Quickly Apply the Fill Color of a Table Cell to the Whole Row, Column or Table

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.    Quickly Apply the Fill Color of a Table Cell to the Whole Row, Column or Table

Method 1: Manually Get the RGB Value of Table Cell

  1. First of all, select the cell whose fill color you need to get.
  2. Next click “Design” tab.
  3. Find the command below “Shading” and click on the drop-down button on that command.
  4. On the menu choose “Borders and Shading” to open the same name dialog box.Select a Cell->Click "Design"->Choose "Borders and Shading"
  5. Next in the box open, click “Shading” tab.
  6. Go to “Fill” field and click on the drop-down button.
  7. And select “More Colors” to open “Colors” box.
  8. Choose “RGB” for the “Color model” field. Get the RGB value below.Click "Shading"->Click Drop-down Button->Choose "More Colors"->Click "Custom"->Choose "RGB"
  9. Then close all boxes and put cursor inside target cell. Or you can select multiple cells, rows, columns or even the entire table.
  10. And click drop-down button on “Shading” command to select “More Colors”.
  11. 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.

  1. Firstly, place insertion pointer inside the filled cell.
  2. 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.Get RGB Value from the Pane
  3. 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.

  1. To begin with, position insertion pointer inside a colored cell.
  2. Press “Alt+ F11” to trigger VBA editor.
  3. Next click “Normal” project and click “Insert” tab.
  4. Then choose “Module” on that menu.Click "Normal"->Click "Insert"->Click "Module"
  5. Open it by double click.
  6. 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
  1. Lastly, click “Run” or hit “F5”.Paste Codes->Click "Run"

Method 4: Apply Fill Color of One Cell to the Whole Row via VBA

  1. At first, put cursor inside a cell.
  2. Next install and run a macro following exactly the same steps in method 3.
  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

  1. Likely, put cursor inside a cell first.
  2. Then install and run a macro properly.
  3. 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

Your email address will not be published. Required fields are marked *