Skip to content

Strip junk styles ​

Location on ribbon: Tab DVD Addin → Group Cells and Rows → the ▾ arrow of Delete blanks

Command ID: btnDeleteCellStyles

What it does ​

The command opens an Excel file on disk (an xlsx is just a zip) and strips the junk Cell Styles out of xl/styles.xml — every cellStyle entry that is not one of Excel's built-in styles. These pile up when sheets are copied back and forth between workbooks, leaving a Cell Styles gallery thousands of entries long, a bloated file and painfully slow opening.

Use it when a quantity or programme workbook received from another party takes a minute to open, scrolls in jerks, or when Excel reports "Too many different cell formats".

How to use ​

  1. Close the file you want to clean in Excel — the command works on the file on disk, so it must not be open.
  2. Click DVD Addin → Cells and Rows → the ▾ arrow of Delete blanks → Strip junk styles.
  3. A file picker titled "Pick xlsx file" appears, filtered to *.xlsx; *.xlsm; *.xlam. Select one file and click OK.
  4. The command processes the file and reports the result: "Removed n junk styles" with the path of the kept original, or "No junk styles found".
  5. Reopen the file and check Home → Cell Styles — the gallery is back to normal.

Video tutorial ​

Narrated in Vietnamese, with Vietnamese subtitles. Xoá dòng trống, dòng ẩn, format, Name lỗi, Cell Style · 6 min 22 s · 14 cases · Download the video · Practice workbook for the video

Commands in this video: Delete blanks · Strip junk styles · Delete error Defined Names · Delete hidden rows · Delete unused formats

Chapters (18)
  1. Giới thiệu
  2. Mở lệnh
  3. 1 · Bảng xuất từ dự toán
  4. 2 · Cột công thức kéo dài
  5. 3 · Ghi chú ngoài vùng chọn
  6. 4 · Dòng trống đang ẩn
  7. 5 · Ô gộp nhiều dòng
  8. 6 · Chọn cả cột
  9. 7 · Xoá dòng ẩn: bảng đã lọc
  10. 8 · Xoá dòng ẩn: nhóm thu gọn
  11. 9 · Xoá format không dùng
  12. 10 · Ô lạc làm dọn hụt
  13. 11 · Xoá Defined Names lỗi
  14. 12 · Xoá Cell Style ngoại lai
  15. 13 · Ghi đè và hoàn tác
  16. 14 · Sheet khoá, lệnh không chạy
  17. Mẹo
  18. Kết thúc

Illustrated walkthrough ​

Step 1. Close the file to clean in Excel — the command works on the file on disk, so it must not be open (OneDrive-synced files included).

Step 2. On the ribbon, open the DVD Addin tab → Cells and Rows group → open Delete blanks → choose Strip junk styles.

DVD Addin ▸ Cells and Rows ▸ Delete blanks ▸ Strip junk styles

Step 3. A file picker titled Pick xlsx file opens, filtered to *.xlsx; *.xlsm; *.xlam. Pick one file, for example D:\DuAn\NhaVanPhong9Tang\Tien do thi cong - Goi thau 02.xlsx, and click OK.

Step 4. The command cleans a temporary copy and only then swaps it in for the original, then reports Removed 3874 junk styles. together with the name of the untouched original kept next to it (Tien do thi cong - Goi thau 02_backup-20261008-143015.xlsx). With no junk styles it says No junk styles found. and changes nothing.

Step 5. Reopen the file and check that Home ▸ Cell Styles only lists Excel's built-in styles. Once satisfied, delete the _backup-… copy yourself.

Example ​

Construction programme - Package 02.xlsx is 42 MB and takes over a minute to open because sheets from six subcontractors were merged into it. Close the file, run the command, pick the file in the dialog — the message reads "Removed 3,874 junk styles". Reopen it: the Cell Styles gallery holds only Excel's standard styles and the file opens in a few seconds.

Notes ​

  • The command does not edit the original in place: it cleans a temporary copy in the same folder and only then swaps it in; the original (uncleaned) file is kept next to it as <file name>_backup-<date-time>.xlsx. Delete that copy yourself once you have checked the result. (Before the next release the command overwrote the original directly — a failure half-way broke the file.)
  • A file with an open password (Encrypt with Password) cannot be read as a zip package — the command says so and touches nothing.
  • A file currently open in Excel is refused with a message asking you to close the workbook first (OneDrive-synced files are matched by their local path too).
  • Only .xlsx, .xlsm and .xlam are supported. Legacy .xls files must be saved as .xlsx first.
  • Only the surplus style definitions are removed; direct cell formatting (font, fill, borders) is untouched.
  • If the file has no xl/styles.xml or no junk styles, the command reports that and leaves the file unchanged.

Released under DVDAddin License.