![]() |
Clearing row colour & row data
Daily Schedule Coloumn A is a list of names Coloumn E is a drop down menu with the options of blank, Sick and AL Coloumns F-AC are 30min time cells I have a colour counting macro so what ever colour i change a sell to will count it as 0.5. I have an update button i press to calculate the hours once i have put in all the different colours. However if i select the Sick or AL drop down menu after i've done the colours it greys out the whole line as i want, but if i update again its still counting the colours that were should before, i guess this has something to do with the conditional formating. Is it possible get a macro to delete the data and cell colour so this doesn't happen? I have attached my spreedsheet so you can see what i mean +-------------------------------------------------------------------+ |Filename: MASTER 2006.zip | |Download: http://www.excelforum.com/attachment.php?postid=5246 | +-------------------------------------------------------------------+ -- alex1982 ------------------------------------------------------------------------ alex1982's Profile: http://www.excelforum.com/member.php...o&userid=37494 View this thread: http://www.excelforum.com/showthread...hreadid=573570 |
Clearing row colour & row data
Add this code
Private Sub Worksheet_Change(ByVal Target As Range) Const WS_RANGE As String = "E26:E72,E74:E87" On Error GoTo ws_exit Application.EnableEvents = False If Not Intersect(Target, Range(WS_RANGE)) Is Nothing Then With Target For Each cell In .Offset(0, 1).Resize(1, 24) cell.Interior.ColorIndex = xlColorIndexNone Next cell End With Call Update End If ws_exit: Application.EnableEvents = True 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 Bob Phillips (replace somewhere in email address with gmail if mailing direct) "alex1982" wrote in message ... Daily Schedule Coloumn A is a list of names Coloumn E is a drop down menu with the options of blank, Sick and AL Coloumns F-AC are 30min time cells I have a colour counting macro so what ever colour i change a sell to will count it as 0.5. I have an update button i press to calculate the hours once i have put in all the different colours. However if i select the Sick or AL drop down menu after i've done the colours it greys out the whole line as i want, but if i update again its still counting the colours that were should before, i guess this has something to do with the conditional formating. Is it possible get a macro to delete the data and cell colour so this doesn't happen? I have attached my spreedsheet so you can see what i mean +-------------------------------------------------------------------+ |Filename: MASTER 2006.zip | |Download: http://www.excelforum.com/attachment.php?postid=5246 | +-------------------------------------------------------------------+ -- alex1982 ------------------------------------------------------------------------ alex1982's Profile: http://www.excelforum.com/member.php...o&userid=37494 View this thread: http://www.excelforum.com/showthread...hreadid=573570 |
Clearing row colour & row data
Thanks Bob you are a sta -- alex198 ----------------------------------------------------------------------- alex1982's Profile: http://www.excelforum.com/member.php...fo&userid=3749 View this thread: http://www.excelforum.com/showthread.php?threadid=57357 |
All times are GMT +1. The time now is 03:28 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com