#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Highlights

I want to Highlight more than five brand name with
different colors in my complete workbook. Lets say when I
type Brand1 it will make the cell background in Red, for
Brand2 = Green, Brand 3=Blue, Brand4=Pink and Brand 5 =
DarkRed. How I will write the code for this one. Or how
can I write Select case in Excel?
Please reply urgently
Thanks and regards
Waahab

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Highlights

Waha

In the worksheet module put the following code

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range

Select Case Target.Valu
Case "Brand1
Target.Interior.ColorIndex =
Case "Brand2
Target.Interior.ColorIndex =
Case "Brand3
Target.Interior.ColorIndex =
Case "Brand4
Target.Interior.ColorIndex =
Case "Brand5
Target.Interior.ColorIndex =
Case Els
Target.Interior.ColorIndex = xlNon
End Selec
End Su

You may want to modify the colorindex values to suit. Note also that this is case sensitive. Brand1 will work, but brand1 will not

Ton

----- Wahab wrote: ----

I want to Highlight more than five brand name with
different colors in my complete workbook. Lets say when I
type Brand1 it will make the cell background in Red, for
Brand2 = Green, Brand 3=Blue, Brand4=Pink and Brand 5 =
DarkRed. How I will write the code for this one. Or how
can I write Select case in Excel
Please reply urgentl
Thanks and regard
Waaha


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Highlights

Try using Conditional formating
-----Original Message-----
I want to Highlight more than five brand name with
different colors in my complete workbook. Lets say when I
type Brand1 it will make the cell background in Red, for
Brand2 = Green, Brand 3=Blue, Brand4=Pink and Brand 5 =
DarkRed. How I will write the code for this one. Or how
can I write Select case in Excel?
Please reply urgently
Thanks and regards
Waahab

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Highlights


-----Original Message-----
I want to Highlight more than five brand name with
different colors in my complete workbook. Lets say when I
type Brand1 it will make the cell background in Red, for
Brand2 = Green, Brand 3=Blue, Brand4=Pink and Brand 5 =
DarkRed. How I will write the code for this one. Or how
can I write Select case in Excel?
Please reply urgently
Thanks and regards
Waahab

.
Thank you Mr. Tony , Is there any way that it will work

same like in MS Access after update, I mean when I update
the cellvalue same time it'll make the background color
to? In that case I dont have to move my cell around.
Thank you very much.
Wahab
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
Linking Equations to Highlights Q Excel Worksheet Functions 2 May 31st 10 02:28 AM
Top Ten highlights all James Excel Worksheet Functions 1 October 16th 07 01:22 AM
How to filter on highlights? CYNTHIA Excel Discussion (Misc queries) 1 July 18th 07 04:42 PM
cursor highlights everything Dino Excel Discussion (Misc queries) 1 December 30th 05 10:47 AM
Printing Highlights? mazile Excel Discussion (Misc queries) 0 August 23rd 05 08:31 PM


All times are GMT +1. The time now is 06:15 AM.

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"