+ Reply to Thread
Results 1 to 4 of 4

Manipulating Data in a row

  1. #1
    Gsurfdude
    Guest

    Manipulating Data in a row

    Hello,

    How do I change data in a column via VBA. Here's what I am referring to: In
    column A I have data that looks like this
    0001
    0002
    0003

    I need to take off the leading 0 so it looks like this:
    001
    002
    003

    Any help would be appreciated !

    Developer

  2. #2
    Cesar Zapata
    Guest

    Re: Manipulating Data in a row

    one way.

    Sub takezero()

    Dim cell As Range
    For Each cell In Range("A1:A100")
    cell.Value = Right(cell.Value, Len(cell.Value) - 1)
    Next cell



    End Sub


  3. #3
    Tom Ogilvy
    Guest

    Re: Manipulating Data in a row

    for each cell in selection
    cell.Value = "'" & Right(cell.Text,3)
    Next

    This assumes the zeros are not produced using a custom format.
    If that is the case, just change the custom format.

    --
    Regards,
    Tom Ogilvy


    "Gsurfdude" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    >
    > How do I change data in a column via VBA. Here's what I am referring to:

    In
    > column A I have data that looks like this
    > 0001
    > 0002
    > 0003
    >
    > I need to take off the leading 0 so it looks like this:
    > 001
    > 002
    > 003
    >
    > Any help would be appreciated !
    >
    > Developer




  4. #4
    Gsurfdude
    Guest

    Re: Manipulating Data in a row

    Tom:

    Thanks. This worked fine and what was needed..

    Thanx again

    "Tom Ogilvy" wrote:

    > for each cell in selection
    > cell.Value = "'" & Right(cell.Text,3)
    > Next
    >
    > This assumes the zeros are not produced using a custom format.
    > If that is the case, just change the custom format.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Gsurfdude" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello,
    > >
    > > How do I change data in a column via VBA. Here's what I am referring to:

    > In
    > > column A I have data that looks like this
    > > 0001
    > > 0002
    > > 0003
    > >
    > > I need to take off the leading 0 so it looks like this:
    > > 001
    > > 002
    > > 003
    > >
    > > Any help would be appreciated !
    > >
    > > Developer

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1