Created
April 1, 2014 00:45
-
-
Save philbritton/9905578 to your computer and use it in GitHub Desktop.
macro to change data type for crm extracts
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 CrmConvertFields() | |
' | |
' CrmConvertFields Macro | |
' | |
Dim txt As String | |
Dim num As Double | |
For Each Cell In Selection.Cells | |
txt = Cell.Value | |
txt = Replace(txt, "$", "") | |
txt = Replace(txt, ",", "") | |
If Len(txt) > 0 Then | |
Dim txtNum As String | |
txtNum = Right(txt, Len(txt) - 1) | |
If (IsNumeric(txtNum)) Then | |
Cell.Value = Val(txtNum) | |
End If | |
If (IsDate(txt)) Then | |
Cell.Value = DateValue(txt) | |
End If | |
End If | |
Next | |
' | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment