Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Change colour of cells when content is altered/changed
Hi
I have a number of worksheets where the cell colour used to change to Blue when an entry was made or edited But it ain't doing it any more -------------------------------------- This is the code Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) End Sub Private Sub Worksheet_Change(ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub ------------------------------------------------- I didn't write the code, more likely someone created it for me Would anyone know why the above code has stopped working and how to fix it please ? -- Martin ©¿©¬ |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Change colour of cells when content is altered/changed
The code appears to work fine, as written, but will only perform on the one
sheet where it's installed.......if you want it to work on other sheets, it must be copied to their code sections as well.......... Vaya con Dios, Chuck, CABGx3 "Martin ©¿©¬ lid" wrote: Hi I have a number of worksheets where the cell colour used to change to Blue when an entry was made or edited But it ain't doing it any more -------------------------------------- This is the code Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) End Sub Private Sub Worksheet_Change(ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub ------------------------------------------------- I didn't write the code, more likely someone created it for me Would anyone know why the above code has stopped working and how to fix it please ? -- Martin ©¿©¬ |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Change colour of cells when content is altered/changed
Usually, when you first start Excel, a pop-up will ask if you want the macros
enabled or not..........just indicate affirmative. In Excel97, Tools Options GeneralTab uncheck the box for "Macro Virus protection" In other versions it may be under Tools Macros, or Tools Security hth Vaya con Dios, Chuck, CABGx3 "Martin ©¿©¬ lid" wrote: I'm getting messages that the macros are disabled How do I enable them? -- Martin ©¿©¬ On Thu, 7 Dec 2006 07:12:01 -0800, CLR wrote: The code appears to work fine, as written, but will only perform on the one sheet where it's installed.......if you want it to work on other sheets, it must be copied to their code sections as well.......... Vaya con Dios, Chuck, CABGx3 "Martin ©¿©¬ lid" wrote: Hi I have a number of worksheets where the cell colour used to change to Blue when an entry was made or edited But it ain't doing it any more -------------------------------------- This is the code Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) End Sub Private Sub Worksheet_Change(ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub ------------------------------------------------- I didn't write the code, more likely someone created it for me Would anyone know why the above code has stopped working and how to fix it please ? -- Martin ©¿©¬ |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Change colour of cells when content is altered/changed
The first two lines are doing nothing so you could delete them.
The Worksheet_Change code works for me. If you want it available for all sheets place it in the Thisworkbook module as Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub Gord Dibben MS Excel MVP On Thu, 07 Dec 2006 13:44:33 GMT, Martin ©¿©¬ lid wrote: Hi I have a number of worksheets where the cell colour used to change to Blue when an entry was made or edited But it ain't doing it any more -------------------------------------- This is the code Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) End Sub Private Sub Worksheet_Change(ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub ------------------------------------------------- I didn't write the code, more likely someone created it for me Would anyone know why the above code has stopped working and how to fix it please ? |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Change colour of cells when content is altered/changed
Thanks CLR
I re-enabled the macros and they're working now Don't understand how they got disabled Perhaps installing my files to a new pc had something to do with it -- Regards Martin ©¿©¬ On Thu, 7 Dec 2006 07:12:01 -0800, CLR wrote: The code appears to work fine, as written, but will only perform on the one sheet where it's installed.......if you want it to work on other sheets, it must be copied to their code sections as well.......... Vaya con Dios, Chuck, CABGx3 |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Change colour of cells when content is altered/changed
Glad you got it working.........thanks for the feedback.
Vaya con Dios, Chuck, CABGx3 "Martin ©¿©¬ lid" wrote: Thanks CLR I re-enabled the macros and they're working now Don't understand how they got disabled Perhaps installing my files to a new pc had something to do with it -- Regards Martin ©¿©¬ On Thu, 7 Dec 2006 07:12:01 -0800, CLR wrote: The code appears to work fine, as written, but will only perform on the one sheet where it's installed.......if you want it to work on other sheets, it must be copied to their code sections as well.......... Vaya con Dios, Chuck, CABGx3 |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
Change colour of cells when content is altered/changed
On Thu, 07 Dec 2006 09:32:07 -0800, Gord Dibben <gorddibbATshawDOTca
wrote: The first two lines are doing nothing so you could delete them. The Worksheet_Change code works for me. If you want it available for all sheets place it in the Thisworkbook module Thank you very much Gord, I didn't know that That's another thing I've learnt today -- Regards Martin ©¿©¬ Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub Gord Dibben MS Excel MVP |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
Change colour of cells when content is altered/changed
Thanks for the feedback.
Learning something new every day has been my goal in life. Gord On Fri, 08 Dec 2006 13:07:55 GMT, Martin ©¿©¬ lid wrote: On Thu, 07 Dec 2006 09:32:07 -0800, Gord Dibben <gorddibbATshawDOTca wrote: The first two lines are doing nothing so you could delete them. The Worksheet_Change code works for me. If you want it available for all sheets place it in the Thisworkbook module Thank you very much Gord, I didn't know that That's another thing I've learnt today Gord Dibben MS Excel MVP |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formate colour of cells in a range of raw | Excel Discussion (Misc queries) | |||
Formate colour of cells | Excel Discussion (Misc queries) | |||
How to change cases from small to capital in all cells? | Setting up and Configuration of Excel | |||
How do I change a number in one cell to change a series of cells? | Excel Discussion (Misc queries) | |||
Adding colour to a range of cells based on one of the cells v... | Excel Discussion (Misc queries) |