Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Colour
Dear All,
Can any one tell me how to change the colour of selected cell. BR -- ********* IT Manager DeLaval Ltd. Cairo-Egypt ********* |-----------------------------| |Islam is peace not Terror| |-----------------------------| |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Colour
Manually:
From the Format menu, select Cells From the Pattern tab, select a colour Click OK. Example in VBA: Sub test() Range("A1").Interior.Color = vbRed Range("B1").Interior.Color = RGB(255, 128, 255) End Sub You could try recording those manual steps using the macro recorder. -- Rob van Gelder - http://www.vangelder.co.nz/excel "Ibrahim Awwad" <ibrahim_awwad(at)hotmail(dot)com(antispam) wrote in message ... Dear All, Can any one tell me how to change the colour of selected cell. BR -- ********* IT Manager DeLaval Ltd. Cairo-Egypt ********* |-----------------------------| |Islam is peace not Terror| |-----------------------------| |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Colour
Hi
activecell.interior.colorindex=3 "Ibrahim Awwad" wrote: Dear All, Can any one tell me how to change the colour of selected cell. BR -- ********* IT Manager DeLaval Ltd. Cairo-Egypt ********* |-----------------------------| |Islam is peace not Terror| |-----------------------------| |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Colour
Dear Frank,
Well you got my question in a correct way as I need to change the color of active cell. But I tried to put the statement you sent to me in the VB Editor and I saved it with one of the sheets of the workbook. But nothing has worked.... The colors aren't changing at all. ...... "Frank Kabel" wrote: Hi activecell.interior.colorindex=3 "Ibrahim Awwad" wrote: Dear All, Can any one tell me how to change the colour of selected cell. BR -- ********* IT Manager DeLaval Ltd. Cairo-Egypt ********* |-----------------------------| |Islam is peace not Terror| |-----------------------------| |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Colour
Hi
do you need this to happen automaically. That is if you change the active cell this cell should be highlighted?. If yes see: http://cpearson.com/excel/RowLiner.htm "Ibrahim Awwad" wrote: Dear Frank, Well you got my question in a correct way as I need to change the color of active cell. But I tried to put the statement you sent to me in the VB Editor and I saved it with one of the sheets of the workbook. But nothing has worked.... The colors aren't changing at all. ..... "Frank Kabel" wrote: Hi activecell.interior.colorindex=3 "Ibrahim Awwad" wrote: Dear All, Can any one tell me how to change the colour of selected cell. BR -- ********* IT Manager DeLaval Ltd. Cairo-Egypt ********* |-----------------------------| |Islam is peace not Terror| |-----------------------------| |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Colour
Dear Frank,
Thanks for the link but I thought that there's something easier instead of add on. Best Regards "Frank Kabel" wrote: Hi do you need this to happen automaically. That is if you change the active cell this cell should be highlighted?. If yes see: http://cpearson.com/excel/RowLiner.htm "Ibrahim Awwad" wrote: Dear Frank, Well you got my question in a correct way as I need to change the color of active cell. But I tried to put the statement you sent to me in the VB Editor and I saved it with one of the sheets of the workbook. But nothing has worked.... The colors aren't changing at all. ..... "Frank Kabel" wrote: Hi activecell.interior.colorindex=3 "Ibrahim Awwad" wrote: Dear All, Can any one tell me how to change the colour of selected cell. BR -- ********* IT Manager DeLaval Ltd. Cairo-Egypt ********* |-----------------------------| |Islam is peace not Terror| |-----------------------------| |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Colour
Ibrahim,
This is what I use Private Sub Worksheet_SelectionChange(ByVal Target As Range) Cells.FormatConditions.Delete With Target.EntireRow .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" With .FormatConditions(1) With .Borders(xlTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With With .Borders(xlBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With End With .FormatConditions(1).Interior.ColorIndex = 20 End With End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH RP (remove nothere from the email address if mailing direct) "Ibrahim Awwad" <ibrahim_awwad(at)hotmail(dot)com(antispam) wrote in message ... Dear Frank, Thanks for the link but I thought that there's something easier instead of add on. Best Regards "Frank Kabel" wrote: Hi do you need this to happen automaically. That is if you change the active cell this cell should be highlighted?. If yes see: http://cpearson.com/excel/RowLiner.htm "Ibrahim Awwad" wrote: Dear Frank, Well you got my question in a correct way as I need to change the color of active cell. But I tried to put the statement you sent to me in the VB Editor and I saved it with one of the sheets of the workbook. But nothing has worked.... The colors aren't changing at all. ..... "Frank Kabel" wrote: Hi activecell.interior.colorindex=3 "Ibrahim Awwad" wrote: Dear All, Can any one tell me how to change the colour of selected cell. BR -- ********* IT Manager DeLaval Ltd. Cairo-Egypt ********* |-----------------------------| |Islam is peace not Terror| |-----------------------------| |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
textBox font colour the same as cell font colour???????? | Excel Discussion (Misc queries) | |||
How can colour of cell shading be fixed to one colour | Excel Discussion (Misc queries) | |||
change a cell background colour to my own RGB colour requirements | Excel Discussion (Misc queries) | |||
How can i change cell colour depending on month of date in cell? | Excel Discussion (Misc queries) | |||
Conditional Format with VBA - Interior Colour of cell based on value from in-cell dropdown | Excel Programming |