Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete rows with bold or italic text


Hi,

I have a spreadsheet a large spreadsheet. I need to look at the text
in column D and if there is any cell with bold or italicized text in
column D, I want the entire row to be deleted.

Thanks in advance for any help!

Robbin


--
MAYDAY
------------------------------------------------------------------------
MAYDAY's Profile: http://www.excelforum.com/member.php...o&userid=13548
View this thread: http://www.excelforum.com/showthread...hreadid=478043

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Delete rows with bold or italic text

Robbin:

Copy this sub procedure into a module in your workbook.

Sub DeleteRows()

Dim UsedRows As Long
Dim RowCnt As Long

UsedRows = ActiveSheet.UsedRange.Rows.Count

For RowCnt = 1 To UsedRows

Select Case Selection.Item(RowCnt).Font.FontStyle

Case "Bold", "Italic"

Rows(RowCnt).Delete

End Select

Next RowCnt

End Sub

Once you have it there, select the entire row(D) and run the macro,
"DeleteRows", from your macros list. On the odd chance that you don't
understand any of this, reply and I'll talk you through it in more
detail.

Mark

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Delete rows with bold or italic text

Hi Robbin,

Have a go with this (it's based on a continuous column of values and stops
when it gets to a blank ("") cell):

Sub CheckForBold()

Dim wks As Worksheet
Dim iRow As Integer

iRow = 1
Set wks = Application.ActiveSheet

Do Until wks.Cells(iRow, 4).Value = ""
If wks.Cells(iRow, 4).Font.Bold = True Then
wks.Rows(iRow).Delete
Else
iRow = iRow + 1
End If
Loop

End Sub

Best regards

John




"MAYDAY" wrote in
message ...

Hi,

I have a spreadsheet a large spreadsheet. I need to look at the text
in column D and if there is any cell with bold or italicized text in
column D, I want the entire row to be deleted.

Thanks in advance for any help!

Robbin


--
MAYDAY
------------------------------------------------------------------------
MAYDAY's Profile:
http://www.excelforum.com/member.php...o&userid=13548
View this thread: http://www.excelforum.com/showthread...hreadid=478043



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Delete rows with bold or italic text

Sorry, forgot the italics:

Sub CheckForBold()

Dim wks As Worksheet
Dim iRow As Integer

iRow = 1
Set wks = Application.ActiveSheet

Do Until wks.Cells(iRow, 4).Value = ""
If wks.Cells(iRow, 4).Font.Bold = True Or _
wks.Cells(iRow, 4).Font.Italic = True Then
wks.Rows(iRow).Delete
Else
iRow = iRow + 1
End If
Loop

End Sub

"John" wrote in message
...
Hi Robbin,

Have a go with this (it's based on a continuous column of values and stops
when it gets to a blank ("") cell):

Sub CheckForBold()

Dim wks As Worksheet
Dim iRow As Integer

iRow = 1
Set wks = Application.ActiveSheet

Do Until wks.Cells(iRow, 4).Value = ""
If wks.Cells(iRow, 4).Font.Bold = True Then
wks.Rows(iRow).Delete
Else
iRow = iRow + 1
End If
Loop

End Sub

Best regards

John




"MAYDAY" wrote in
message ...

Hi,

I have a spreadsheet a large spreadsheet. I need to look at the text
in column D and if there is any cell with bold or italicized text in
column D, I want the entire row to be deleted.

Thanks in advance for any help!

Robbin


--
MAYDAY
------------------------------------------------------------------------
MAYDAY's Profile:
http://www.excelforum.com/member.php...o&userid=13548
View this thread:
http://www.excelforum.com/showthread...hreadid=478043





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
How copy a cell with mixed text (regular, bold, italic) with a fo. Burkhard Excel Discussion (Misc queries) 1 November 25th 09 11:29 AM
Font/Color/Bold/Italic Remain Same dberger16 Excel Discussion (Misc queries) 2 January 21st 09 08:36 PM
Formula to identify character formatting (bold, italic, etc) alphaorionis Excel Worksheet Functions 3 July 1st 07 11:19 PM
How to apply both Italic & Bold in Header & Footer? Regina Man Excel Discussion (Misc queries) 1 September 26th 05 09:35 AM
Show or hide rows when text is bold or italic Sophisticated Penguin Excel Programming 4 December 1st 04 09:45 AM


All times are GMT +1. The time now is 04:14 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"