Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default VBA - Move cell contents if bold text

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default VBA - Move cell contents if bold text

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

--
Regards,
Tom Ogilvy



"Scott Wagner" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default VBA - Move cell contents if bold text

Thanks Tom!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change cell contents to bold dave@penneys Excel Worksheet Functions 5 September 20th 07 08:25 PM
Join bold and non-bold text in one cell bkincaid Excel Discussion (Misc queries) 3 March 21st 06 12:58 AM
VBA - Delete row if cell contents bold text Scott Wagner Excel Programming 5 February 27th 06 10:14 PM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM
Bold some of the cell contents Brad Excel Programming 4 April 25th 05 04:49 PM


All times are GMT +1. The time now is 02:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"