VBA: Chuyển màu của format conditional thành màu thật

 Do màu fill bằng format conditional sẽ không thể dùng để tính toán hoặc nguy cơ sai lệch khi gửi cho người khác,  nên phải chuyển những ô này thành fill màu bình thường.

Chọn vùng cần bỏ Format conditional và chạy code sau:

Sub removeConditionalFormattingButKeepColors()

Dim cell As Range

For Each cell In Selection

cell.Interior.Color = cell.DisplayFormat.Interior.Color

Next

Selection.FormatConditions.Delete

MsgBox "Done removing conditional formatting rules."

End Sub


Nhận xét