Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Delete entire row based on cell color

Hello,

Could someone show me how to develop a macro that would delete an entire row
depending on the font color (ie: red) of text in column A.

Many thanks.

CMcK
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default Delete entire row based on cell color

This deletes row 5 if the font in column 1 (A) is red:

Sub test()
If Columns(1).Font.ColorIndex = 3 Then Rows(5).Delete
End Sub

HTH

-John Coleman

CMcK wrote:
Hello,

Could someone show me how to develop a macro that would delete an entire row
depending on the font color (ie: red) of text in column A.

Many thanks.

CMcK


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Delete entire row based on cell color

Thanks John. When I look at the line of code it looks extremely
straightforward. I just have difficulty putting together the correct syntax.
Your help is really appreciated - thanks again.

CMcK

"John Coleman" wrote:

This deletes row 5 if the font in column 1 (A) is red:

Sub test()
If Columns(1).Font.ColorIndex = 3 Then Rows(5).Delete
End Sub

HTH

-John Coleman

CMcK wrote:
Hello,

Could someone show me how to develop a macro that would delete an entire row
depending on the font color (ie: red) of text in column A.

Many thanks.

CMcK



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default Delete entire row based on cell color

You're welcome - I didn't completely know the answer until I decided to
reply. I turned on the macro recorder, colored the font in A red and
then deleted a row. I then turned off the macro recorder and looked at
the code. I also double-checked on the help system that you could
replace Columns("A:A") by Columns(1) (which looks slightly better in my
opinion - but you might want to leave it as Columns("A:A"). It's best
to know about both usages, since it might be a hassle to figure out the
column number of column BF for example)
In any event - a combination of the macro recorder and help (and
google) can clear up most questions about syntax. Just remember to
avoid all the selections that the macro recorder records and replact
them by direct references to the relevant objects.

HTH

-John Coleman

CMcK wrote:
Thanks John. When I look at the line of code it looks extremely
straightforward. I just have difficulty putting together the correct syntax.
Your help is really appreciated - thanks again.

CMcK

"John Coleman" wrote:

This deletes row 5 if the font in column 1 (A) is red:

Sub test()
If Columns(1).Font.ColorIndex = 3 Then Rows(5).Delete
End Sub

HTH

-John Coleman

CMcK wrote:
Hello,

Could someone show me how to develop a macro that would delete an entire row
depending on the font color (ie: red) of text in column A.

Many thanks.

CMcK




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
Delete Rows Based on highlighted Color Neon520 Excel Discussion (Misc queries) 7 March 28th 09 08:56 AM
Specify a row based on data from a cell to delete entire row..... Fadedmartinikiss Excel Discussion (Misc queries) 0 March 11th 09 08:39 PM
Hide/Delete entire rows based in the content of one cell Clueless Excel Discussion (Misc queries) 2 October 3rd 05 02:40 PM
delete entire row based on value Gauthier[_2_] Excel Programming 2 September 21st 04 05:26 PM
Delete entire row based on cell content PHIL Excel Programming 2 December 3rd 03 01:39 AM


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