Skip to content

Instantly share code, notes, and snippets.

@miau
Last active November 18, 2015 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miau/a27beec55296244d4ab1 to your computer and use it in GitHub Desktop.
Save miau/a27beec55296244d4ab1 to your computer and use it in GitHub Desktop.
Excel VBA that removes white background color
Sub RemoveWhiteBgcolor()
With Application.FindFormat.Interior
.PatternColorIndex = xlAutomatic
.Color = &HFFFFFF
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Application.ReplaceFormat.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Cells.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment