Last active
October 2, 2017 14:44
-
-
Save enkelmedia/5445af2d577c0c803b8faee78a9bf211 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub NumericFormatting() | |
' | |
' NumericFormatting Macro | |
' | |
' Keyboard Shortcut: Ctrl+Shift+N | |
' | |
Dim cel As Range | |
Dim selectedRange As Range | |
Set selectedRange = Application.Selection | |
For Each cel In selectedRange.Cells | |
If Not cel.HasFormula Then | |
cel.Value = Replace(cel.Text, " ", "") | |
cel.Value = Replace(cel.Text, " ", "") | |
cel.Value = CSng(cel.Value) | |
End If | |
cel.NumberFormat = "#,##0" | |
Next cel | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment