Consulting

Results 1 to 4 of 4

Thread: Delete all character in column

  1. #1

    Delete all character in column

    hi,
    i looking for a a vba codes or way on how can i remove all the character in the column and leave only the numbers.Thanks

  2. #2
    VBAX Mentor MaximS's Avatar
    Joined
    Sep 2008
    Location
    Stoke-On-Trent
    Posts
    360
    Location
    can you give an example of string which needs to be proccessed?

  3. #3
    VBAX Mentor MaximS's Avatar
    Joined
    Sep 2008
    Location
    Stoke-On-Trent
    Posts
    360
    Location
    try this:

    [vba]
    Sub number_collector()

    Dim x, y As String

    For i = 1 To 5
    For j = 1 To Len(Cells(i, 1))

    x = Mid(Cells(i, 1), j, 1)

    If x > Chr(47) And x < Chr(58) Or x = Chr(44) Or x = Chr(46) Then

    y = y + x

    Else

    If y <> "" Then

    GoTo Jump:

    End If

    End If

    Next j
    Jump:
    Cells(i, 2).Value = y
    y = ""
    Next i
    End Sub
    [/vba]

  4. #4
    thanks a lot.Sorry can't reply you quickly...but the code does help..thanks again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •