Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default IF... change colour

Hello all, and good morning!
im celebrating today cause its my Birthday!
anyway, could anyone please help?

i want to search through column "P" and if the value
is "TRUE" i would like to change the colour of the row,

i have the following so far

With ????? .Interior
.ColorIndex = 44
.Pattern = xlSolid
End With

please help.

Thank you,

Robert Couchman
)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default IF... change colour

Hi Robert
why don't you sue conditional formating?
but you may try the following

Dim rng as range
Dim cell as range
set rng = Range("P:P")
for each cell in rng
if cell.value = True then
cell.interior.colorindex=3
end if
next


--
Regards
Frank Kabel
Frankfurt, Germany

Robert Couchman wrote:
Hello all, and good morning!
im celebrating today cause its my Birthday!
anyway, could anyone please help?

i want to search through column "P" and if the value
is "TRUE" i would like to change the colour of the row,

i have the following so far

With ????? .Interior
.ColorIndex = 44
.Pattern = xlSolid
End With

please help.

Thank you,

Robert Couchman
)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default IF... change colour

Thank you for that,

but the code i need is to change the entire rows colour as
some of the cells including this may be hidden on a print
report!

anyone please help??

Robert Couchman
)
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default IF... change colour

Hi Robert
for the entire row change
cell.interior.colorindex=3
to
cell.entirerow.interior.colorindex=3


--
Regards
Frank Kabel
Frankfurt, Germany
"Robert Couchman" schrieb im Newsbeitrag
...
Thank you for that,

but the code i need is to change the entire rows colour as
some of the cells including this may be hidden on a print
report!

anyone please help??

Robert Couchman
)


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default IF... change colour

Robert,

Here is an amendment

Dim rng as range
Dim cell as range
set rng = Range("P:P")
for each cell in rng
if cell.value = True then
cell.entirerow.interior.colorindex=3
end if
next

but you would be better to use CF as Frank suggests, otherwise the row stays
that colour even if the data changes.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert Couchman" wrote in message
...
Thank you for that,

but the code i need is to change the entire rows colour as
some of the cells including this may be hidden on a print
report!

anyone please help??

Robert Couchman
)



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 the colour Jaf Excel Worksheet Functions 1 October 16th 09 05:54 AM
Change cell colour slavenp Excel Discussion (Misc queries) 2 July 14th 09 12:35 PM
HOW TO CHANGE ROW COLOUR adeel via OfficeKB.com New Users to Excel 5 May 23rd 07 11:06 PM
change a cell background colour to my own RGB colour requirements Stephen Doughty Excel Discussion (Misc queries) 4 June 16th 06 01:08 PM
Change Sheet Tab Colour Jenai Excel Discussion (Misc queries) 1 April 22nd 05 06:12 PM


All times are GMT +1. The time now is 02:39 PM.

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

About Us

"It's about Microsoft Excel"