Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Ideal Code deleting rows/based on bold text

Is a code run where it selects only the lines that have bolded text plus one
(above) and delete all others lines that are not qualified. Is this
possible?

Say, there are bold number or text found on rows 5, 8, 12, 22. When the
code runs, it would delete rows

1, 2, 3, 6, 9, 10, 13, 14, 15, 16, 17, 18, 19, and 20.

Can this be done?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Ideal Code deleting rows/based on bold text

Sub test()
Dim i As Long

With ActiveSheet
i = .Cells(Rows.Count, 1).End(xlUp).Row

Do Until i < 1
If .Cells(i, 1).Font.Bold = True Then
i = i - 2
Else
.Rows(i).Delete xlShiftUp
i = i - 1
End If
Loop
End With
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Samm" wrote in message
...
Is a code run where it selects only the lines that have bolded text plus

one
(above) and delete all others lines that are not qualified. Is this
possible?

Say, there are bold number or text found on rows 5, 8, 12, 22. When the
code runs, it would delete rows

1, 2, 3, 6, 9, 10, 13, 14, 15, 16, 17, 18, 19, and 20.

Can this be done?




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
Deleting Rows based on a Value Max2073 Excel Worksheet Functions 2 August 14th 09 01:34 PM
Deleting rows in two columns with a code in visual basic Ruben Excel Discussion (Misc queries) 5 August 27th 08 09:10 AM
Deleting rows based on a cell value JPriest Excel Worksheet Functions 3 August 12th 05 05:44 PM
Deleting Rows based on text in cell & formatting cell based on text in column beside it Steve Excel Programming 4 February 26th 04 03:31 PM
Deleting rows based on criteria John Walker[_2_] Excel Programming 2 December 12th 03 08:37 PM


All times are GMT +1. The time now is 11:04 PM.

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"