I have a button on a worksheet which runs some VB to create a "register" on another worksheet in the same workbook, which all works well. The first column of this "register" will have one of six options in each cell. I would like to be able to change the background of these cells according to its content.
I tried creating a Module with:-
And thought I could then Call this at the end of the VB code I already have. I realise this would normally be called by Worksheet_Change. Is there anyway I can change the code to be able to call it as a macro after the "register" has been built?![]()
Sub Macro1() Dim icolor_service As Integer If Not Intersect(Target, Range("A:A")) Is Nothing Then Select Case Target Case "Terrorist Incident" icolor_service = 3 'Red Case "Operation (pre-planned)" icolor_service = 19 'Pale yellow Case "Exercise" icolor_service = 20 'Lt blue Case "Critical Incident" icolor_service = 35 'Pale green Case "Major Incident" icolor_service = 38 'Pink Case "Incident" icolor_service = 44 'Pale orange End Select Target.Interior.ColorIndex = icolor_service End If End Sub
Bookmarks