Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) If Sh.Name < "Results" Then If Worksheets("Results").Range(Target.Address).Value < "" Then Target.AddComment "Resource already allocated" End If End If End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "GrantW" wrote in message ... I have a workbook which contains 35 job sheets and a resource sheet. All of these sheets contain an identical list of workers down the 4th column, and dates across the 1st row. This gives me a matrix of resources over time. The resource sheet collects the sums of the time allocated to the resources on each job sheet. I want to create an event procedure which is activated when I select a cell ( the cell is the intersection of a worker ( one per row) and a date(one per column)) on any of the job sheets. The event would check the active cell with the corresponding cell address on the resource sheet, to see if the resource was already allocated to another job on that date. The event response for time already allocated to a resource on that date would be to insert a comment in the cell on the job page which informed me of the result from the resource page. In the event of no pre allocated time, there would be no response. Additionally, when the cell is unselected, I guess I am saying when another cell is selected, the previous comment would be deleted. I have done a considerable amount of code on other projects, but I have never ventured into events where I have had to declare things, Public or Private. I have read some of the help topics, but must admit that I am confused and lost. Appreciation for any help you can provide. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using A Macro To Add Event Procedure To A CommandButton | Excel Programming | |||
Using A Macro To Add Event Procedure To A CommandButton | Excel Programming | |||
Using A Macro To Add Event Procedure To A CommandButton | Excel Programming | |||
How to write a macro to import an event procedure to ThisWorbook? | Excel Programming | |||
Using A Macro To Add Event Procedure To A CommandButton | Excel Programming |