Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Writing and erasing code with code
I want to change the color of the active row in a spreadsheet to make
it easier to read. I have the code that accomplishes this task but I want it to work more like an excel option rather than put it on individual workbooks. Is there a way to insert the code I want when the workbook opens then delete when the workbook is closed. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Writing and erasing code with code
Why not just place your code in your personal.xls workbook or by creating an
Addin. Writing and erasing code with code is a bit tricky unless you are reasonably adept with VBA... -- HTH... Jim Thomlinson "bobbo" wrote: I want to change the color of the active row in a spreadsheet to make it easier to read. I have the code that accomplishes this task but I want it to work more like an excel option rather than put it on individual workbooks. Is there a way to insert the code I want when the workbook opens then delete when the workbook is closed. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Writing and erasing code with code
bobbo wrote: I want to change the color of the active row in a spreadsheet to make it easier to read. I have the code that accomplishes this task but I want it to work more like an excel option rather than put it on individual workbooks. Is there a way to insert the code I want when the workbook opens then delete when the workbook is closed. Yes, but only by code that lives in the workbook. There is no ExcelOpen() event that will work when any workbook is open. Any code that you write to write and delete code would be much more complex than code to change the color of the active row, so I don't see the motivation. You could create a registry key that serves as a flag. In the workbooks that you want to have this functionality, in the selection-change event check the key and depending on its value color the active row (and, turn off the color of the previous row - stored in a publc variable perhaps). Also include a short macro to toggle the value of the key. Just an idea -John Coleman |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Writing and erasing code with code
Interesting - I wasn't aware of application level events. It is still
true that such code must reside in *some* workbook and thus does not reside persistently in the application itself - but you can put it into an Add-in or Personal.xls and have something functionally equivalent to an ExcelOpen() event which can apply to all workbooks. Thanks for the info and the link to Pearson's site. Dave Peterson wrote: Maybe you can move your code into an application level event. Chip Pearson has a bunch of notes for application events: http://www.cpearson.com/excel/AppEvent.htm Or you may want to just use Chip's RowLiner addin: http://www.cpearson.com/excel/RowLiner.htm bobbo wrote: I want to change the color of the active row in a spreadsheet to make it easier to read. I have the code that accomplishes this task but I want it to work more like an excel option rather than put it on individual workbooks. Is there a way to insert the code I want when the workbook opens then delete when the workbook is closed. -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Writing and erasing code with code
Thanks for all your help. I found Chip Pearsons site while researching
this problem and found the method to write code with code. I will have to look at the application level events info. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IS IT POSSIBLE IN EXCEL WITHOUT WRITING CODE. | Excel Worksheet Functions | |||
Need help writing Code | Excel Discussion (Misc queries) | |||
Code Erasing Cell Contents Inappropriately | Excel Programming | |||
Need some help writing code. | Excel Programming | |||
Writing a formula in code | Excel Programming |