Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() -----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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Wahab
If you put the code into the worksheet module, then when the data is entered, the cell background will immeditately update. To put it into a worksheet module, right click on the sheet tab, pick view code and put the code in there. Tony ----- wrote: ----- -----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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Linking Equations to Highlights | Excel Worksheet Functions | |||
Top Ten highlights all | Excel Worksheet Functions | |||
How to filter on highlights? | Excel Discussion (Misc queries) | |||
cursor highlights everything | Excel Discussion (Misc queries) | |||
Printing Highlights? | Excel Discussion (Misc queries) |