Sub trimdata()
Dim Rng As Range
Dim WorkRng As Range
Dim rep As String
On Error Resume Next
xTitleId = "Excel Forum"
Set WorkRng = Application.Selection
'Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
Rng.NumberFormat = ("#.###############################")
xout = ""
For i = 1 To Len(Rng.Text)
xTemp = Mid(Rng.Text, i, 1)
If xTemp Like "[-0-9.]" Then
xStr = xTemp
Else
xStr = ""
End If
xout = xout & xStr
Next i
If xout = "" Then
Rng.ClearContents
Else
If IsNumeric(xout) Then
Rng = xout
Else
Rng = ""
End If
End If
Next
Selection.NumberFormat = ("0.0############################")
End Sub
AnalystSolutions respects your privacy and will never share your information with others. You can remove yourself from any distribution with one click.
AnalystSolutions respects your privacy and will never share your information with others. You can remove yourself from any distribution with one click.
We offer free full versions of our content for evaluation purposes (valued at over $700) to professionals holding the following roles:
You will receive:
To ensure a quick verification of your role above (usually within one business day), please provide the email address issued by your organization.
You will be directed to the FREE SAMPLE EDITION of our GAMMA PI™ Equity Research Analyst Self-Assessment. Please provide a valid email address to receive your results (your email address remains confidential within AnalystSolutions).
Please answer these questions to help James Valentine prepare for your call (he will keep your responses confidential)
You will be directed to our 20-question quiz to determine if you possess the skills of a seasoned equity research analyst. Please provide a valid email address to receive your results (your email address remains confidential within AnalystSolutions):
We will attempt to reply to you within one business day based upon the responses to our questions below.