VBA - Move cell contents if bold text

S

Scott Wagner

I have a piece of information (marking) that appears sometimes in column B of
my worksheet one row below a master line. Markings are not always used.
When a marking is present it is always in bold text. I'd like to move the
value from column B to column E and up one row.

For example: (what I have now)
A | B | C | D | E |
1 | 2 | Panelboard | | |
| Marking (bold text) | | | |
| Other entry (not bold text) | | | |

What I would like to end up with:
A | B | C | D | E |
1 | 2 | Panelboard | |Marking (bold text) |
| Other entry (not bold text) | | | |


Thanks in advance!

Scott
 
T

Tom Ogilvy

lastrow = cells(rows.count,2).End(xlup).row
for i = lastrow to 2 step -1
if cells(i,2).Font.bold then
cells(i-1,5).Value = cells(i,2).Value
rows(i).Delete
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

Top