+ Reply to Thread
Results 1 to 3 of 3

Macro to move cell contents based on formatting

Hybrid View

  1. #1
    Scott Wagner
    Guest

    Macro to move cell contents based on formatting

    I have a sheet that some data is identified by bold text as being an item
    marking, in the same column other items (not in bold) are part numbers. Need
    to seperate those two things (part numbers and markings) into two different
    columns.

    How is this done with a macro?

    Thanks,

    Scott



  2. #2
    Tom Ogilvy
    Guest

    Re: Macro to move cell contents based on formatting

    Dim cell as Range, rng as range
    set rng = Range(cells(1,ActiveCell.Column), _
    Cells(rows.count,ActiveCell.Column).End(xlup))
    ActiveCell.Entirecolumn.Offset(0,1).Insert
    for each cell in rng
    if not cell.font.bold then
    cell.offset(0,1).Value = cell.value
    cell.clearcontents
    end if
    Next

    --
    Regards,
    Tom Ogilvy

    "Scott Wagner" <ScottWagner@discussions.microsoft.com> wrote in message
    news:6F53A1CF-5B1B-49C0-932B-128FC282A285@microsoft.com...
    > I have a sheet that some data is identified by bold text as being an item
    > marking, in the same column other items (not in bold) are part numbers.

    Need
    > to seperate those two things (part numbers and markings) into two

    different
    > columns.
    >
    > How is this done with a macro?
    >
    > Thanks,
    >
    > Scott
    >
    >




  3. #3
    Scott Wagner
    Guest

    Re: Macro to move cell contents based on formatting

    PERFECT!

    Thanks so much!

    "Tom Ogilvy" wrote:

    > Dim cell as Range, rng as range
    > set rng = Range(cells(1,ActiveCell.Column), _
    > Cells(rows.count,ActiveCell.Column).End(xlup))
    > ActiveCell.Entirecolumn.Offset(0,1).Insert
    > for each cell in rng
    > if not cell.font.bold then
    > cell.offset(0,1).Value = cell.value
    > cell.clearcontents
    > end if
    > Next
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Scott Wagner" <ScottWagner@discussions.microsoft.com> wrote in message
    > news:6F53A1CF-5B1B-49C0-932B-128FC282A285@microsoft.com...
    > > I have a sheet that some data is identified by bold text as being an item
    > > marking, in the same column other items (not in bold) are part numbers.

    > Need
    > > to seperate those two things (part numbers and markings) into two

    > different
    > > columns.
    > >
    > > How is this done with a macro?
    > >
    > > Thanks,
    > >
    > > Scott
    > >
    > >

    >
    >
    >


+ 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