Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Can an excel macro handle colours ?

I have Excel 2002sp3 on WinXP. Every week I get an excel spreadsheet listing
companies that have gone bankrupt. The company data is detailed across a
number of columns, with each company taking up one row and being listed
alphabetically.The compilation of the list starts on 1 January, continues
for the year, and is added to (updated) each week. The new bankrupt
companies, the new rows, are highlighted in yellow.



I need to print out just the new rows, the rows that are highlighted yellow.
Is there any way I can have a macro test the row to see if it is yellow, and
if NOT delete, so that I am left with a spreadsheet of only yellow rows
which I can then print. Currently I do this manually, how can I do it with a
macro ?



with thanks … Roger


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Can an excel macro handle colours ?

Here is some code

Sub DeleteRows()
Dim cLastRow As Long
Dim i As Long

cLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = cLastRow To 1 Step -1
If Cells(i, "A").Interior.ColorIndex = 6 Then
Cells(i, "A").EntireRow.Delete
End If
Next i

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Roger Ottaway" wrote in message
...
I have Excel 2002sp3 on WinXP. Every week I get an excel spreadsheet

listing
companies that have gone bankrupt. The company data is detailed across a
number of columns, with each company taking up one row and being listed
alphabetically.The compilation of the list starts on 1 January, continues
for the year, and is added to (updated) each week. The new bankrupt
companies, the new rows, are highlighted in yellow.



I need to print out just the new rows, the rows that are highlighted

yellow.
Is there any way I can have a macro test the row to see if it is yellow,

and
if NOT delete, so that I am left with a spreadsheet of only yellow rows
which I can then print. Currently I do this manually, how can I do it with

a
macro ?



with thanks . Roger




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Can an excel macro handle colours ?

Thanks for your help, it works great ... but it does the opposite of what I
want. The macro deletes the yellow lines ... I want it to delete the lines
THAT ARE NOT yellow so that I only have yellow lines left !!

thanks .. Roger

"Bob Phillips" wrote in message
...
Here is some code

Sub DeleteRows()
Dim cLastRow As Long
Dim i As Long

cLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = cLastRow To 1 Step -1
If Cells(i, "A").Interior.ColorIndex = 6 Then
Cells(i, "A").EntireRow.Delete
End If
Next i

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Roger Ottaway" wrote in message
...
I have Excel 2002sp3 on WinXP. Every week I get an excel spreadsheet

listing
companies that have gone bankrupt. The company data is detailed across a
number of columns, with each company taking up one row and being listed
alphabetically.The compilation of the list starts on 1 January,

continues
for the year, and is added to (updated) each week. The new bankrupt
companies, the new rows, are highlighted in yellow.



I need to print out just the new rows, the rows that are highlighted

yellow.
Is there any way I can have a macro test the row to see if it is yellow,

and
if NOT delete, so that I am left with a spreadsheet of only yellow rows
which I can then print. Currently I do this manually, how can I do it

with
a
macro ?



with thanks . Roger






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Can an excel macro handle colours ?

Roger,

Change the = 6 to < 6

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Roger Ottaway" wrote in message
...
Thanks for your help, it works great ... but it does the opposite of what

I
want. The macro deletes the yellow lines ... I want it to delete the lines
THAT ARE NOT yellow so that I only have yellow lines left !!

thanks .. Roger

"Bob Phillips" wrote in message
...
Here is some code

Sub DeleteRows()
Dim cLastRow As Long
Dim i As Long

cLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = cLastRow To 1 Step -1
If Cells(i, "A").Interior.ColorIndex = 6 Then
Cells(i, "A").EntireRow.Delete
End If
Next i

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Roger Ottaway" wrote in message
...
I have Excel 2002sp3 on WinXP. Every week I get an excel spreadsheet

listing
companies that have gone bankrupt. The company data is detailed across

a
number of columns, with each company taking up one row and being

listed
alphabetically.The compilation of the list starts on 1 January,

continues
for the year, and is added to (updated) each week. The new bankrupt
companies, the new rows, are highlighted in yellow.



I need to print out just the new rows, the rows that are highlighted

yellow.
Is there any way I can have a macro test the row to see if it is

yellow,
and
if NOT delete, so that I am left with a spreadsheet of only yellow

rows
which I can then print. Currently I do this manually, how can I do it

with
a
macro ?



with thanks . Roger








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 can I customise colours used in charts and keep those colours. LJ Charts and Charting in Excel 3 May 20th 10 01:50 PM
How to save one of the MORE COLOURS in the THEME COLOURS? Wulfy Excel Discussion (Misc queries) 0 August 18th 09 10:25 AM
what is "fill handle". i don't see any fill handle in my excel Neelakanta New Users to Excel 32 June 18th 08 12:48 PM
Fill handle turned into a move handle Northwoods Excel Discussion (Misc queries) 1 March 2nd 07 03:40 PM
Excel 2003 font colours and cell colours bretta Excel Discussion (Misc queries) 1 April 17th 05 03:45 AM


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