Macro to move cell contents based on formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
PERFECT!

Thanks so much!

Tom Ogilvy said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top