Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi all,
I have a problem, using code from this forum (from David McRitchie, thanx Dave) I have created a Conditional formatting macro in my worksheet change event macro. This works a treat, apart from one issue that the users of the spreadsheet have complained about. 'Undo Functionality' it seems that the undo functionality of any worksheet with this macro is broken. I have heard there is no way around it. Any ideas? Any help would be hugely appreciated. NOTE: This is in Excel 2003 SP2, if that helps Find below the macro I am using. Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo errorhandler Dim cRange As Range Dim cell As Range Dim icolor As Integer Dim target2 As String '***************** check range **** Set cRange = Intersect(Range(ActiveWorkbook.Names("status")), Range(Target(1).Address)) If cRange Is Nothing Then Exit Sub '********************************** For Each cell In Target If cell = "N/A" Then icolor = 38 Else target2 = Left(cell, 1) Select Case target2 Case "f" icolor = 3 Case "p" icolor = 4 Case "b" icolor = 46 Case "-" icolor = 36 Case Else icolor = 2 End Select End If Application.EnableEvents = False 'should be part of Change macro cell.Interior.ColorIndex = icolor Application.EnableEvents = True 'should be part of Change macro Next cell Exit Sub errorhandler: icolor = 0 Target.Interior.ColorIndex = icolor End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Add protect worksheet password in macro | Excel Worksheet Functions | |||
Need help updating my macro to include a 2nd worksheet. | Excel Worksheet Functions | |||
Help with a macro to open to a specific worksheet | Excel Worksheet Functions | |||
Copy cell format to cell on another worksht and update automatical | Excel Worksheet Functions | |||
Where to stick macro to change default comment font? | Excel Discussion (Misc queries) |