Skip to content

Instantly share code, notes, and snippets.

@ateneva
Last active April 16, 2017 15:29
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 ateneva/8de59b0b84eb3eddad5fb6d5951cd443 to your computer and use it in GitHub Desktop.
Save ateneva/8de59b0b84eb3eddad5fb6d5951cd443 to your computer and use it in GitHub Desktop.
Zap formulas based on cell value
Sub ZapValuesNoUserInput()
Dim Cell As Range
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'written by Angelina Teneva, September 2016
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'paste special as values
For Each Cell In ActiveSheet.Range("AB2:AB" & ActiveSheet.UsedRange.Rows.Count)
On Error Resume Next
If Cell.Value <> "0" And Len(Cell) > 1 Then
Cell.Activate
ActiveCell.Copy
ActiveCell.PasteSpecial xlPasteValuesAndNumberFormats
End If
Next Cell
Application.CutCopyMode = False
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment