+ Reply to Thread
Results 1 to 3 of 3

General Loop question

  1. #1
    jhahes
    Guest

    General Loop question

    Can someone please help me with the following!

    I just want to do this

    Start in Cell b2

    activecell.offset(0,5).value = cdbl(Activecell.value)

    then go to b3
    b4
    b5


    all the way until row 500.

    I am trying to convert these text strings to number format without retyping them.

    Thanks
    Josh

  2. #2
    Tom Ogilvy
    Guest

    Re: General Loop question

    Sub convertStrings()
    Dim cell as Range
    for each cell in Range("B2:B50")
    if isnumeric(cell.value) then
    cell.offset(0,5).Value = cdbl(cell.value)
    end if
    next
    End sub

    --
    Regards,
    Tom Ogilvy

    "jhahes" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Can someone please help me with the following!
    >
    > I just want to do this
    >
    > Start in Cell b2
    >
    > activecell.offset(0,5).value = cdbl(Activecell.value)
    >
    > then go to b3
    > b4
    > b5
    >
    >
    > all the way until row 500.
    >
    > I am trying to convert these text strings to number format without
    > retyping them.
    >
    > Thanks
    > Josh
    >
    >
    > --
    > jhahes
    > ------------------------------------------------------------------------
    > jhahes's Profile:

    http://www.excelforum.com/member.php...o&userid=23596
    > View this thread: http://www.excelforum.com/showthread...hreadid=474780
    >




  3. #3
    JE McGimpsey
    Guest

    Re: General Loop question

    One way:

    With Range("B2:B500")
    .Offset(0, 5).Value = .Value
    Cells(Rows.Count, Columns.Count).Copy 'assume empty cell
    .Offset(0, 5).PasteSpecial Paste:=xlPasteValues, _
    Operation:=xlPasteSpecialOperationAdd
    End With


    In article <[email protected]>,
    jhahes <[email protected]> wrote:

    > Can someone please help me with the following!
    >
    > I just want to do this
    >
    > Start in Cell b2
    >
    > activecell.offset(0,5).value = cdbl(Activecell.value)
    >
    > then go to b3
    > b4
    > b5
    >
    >
    > all the way until row 500.
    >
    > I am trying to convert these text strings to number format without
    > retyping them.
    >
    > Thanks
    > Josh


+ 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