View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Per Jessen[_2_] Per Jessen[_2_] is offline
external usenet poster
 
Posts: 703
Default REPSOT?? Sub Worksheet_Change(ByVal Target As Range)

Fill color should change to green.

To ensure that events are enabled enter this in Immediate window and
hit enter:

Application.EnableEvents=True

Also you can insert a break point at the first line of the macro to
verify that the macro fires.

Regards,
Per



On 10 Okt., 14:16, "Ed Davis" wrote:
Put this code in Thisworkbook module
Changed data on 2 sheets in cells G15 and H23 nothing happened.
No change in color.

--
Thank You in Advance
Ed Davis"Per Jessen" wrote in message

...
Hi Ed

Insert this in the codes sheet for ThisWorkbook, and it will fire on
changes in all sheets. If you have a sheet or two where you do not
want this feature, it can we can fix this too:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
Set isect = Intersect(Range("G12:H51,P40:Q44,P48:Q60,Q14:Q17") ,
Target)
If Not isect Is Nothing Then
* * Application.EnableEvents = False
* * Target.Interior.ColorIndex = 4
* * Application.EnableEvents = True
End If
End Sub

Regards,
Per

On 10 Okt., 11:30, "Ed Davis" wrote:



I have 4 rages of cells that if any cell in these ranges changes I would
like to change the Background and Foreground colors.
However I only want to change that cells color not all of them.
Rather than use "Sub Worksheet_Change(ByVal Target As Range)" I would like
to use a macro because I have 32 sheets with these same ranges.
Currently when the user changes any of these cells a macro runs that saves
the active sheet as a workbook and changes the tab color to red to
indicate
a change has (possibly) been made.


I currently have no way of knowing what cell has been changed or for that
matter if any changes have been made at all.


The cell ranges are G12:H51, P40:Q44, P48:Q60 and Q14:Q17.
These cells have formulas in them and I allow the user to over ride with a
number if it is incorrect.


I tried CF and have had no success.
A function was created to check if the cells had a formula. When using the
formula in CF it made a lot of other macros BOMB. Don't know the reason
but
when that CF was removed all macros ran properly again.


I have seen a lot of information on using "Sub Worksheet_Change(ByVal
Target
As Range)" but they all refer to 1 range and coloring the whole range.


Any help with this would be greatly appreciated.


--
Thank You in Advance
Ed Davis- Skjul tekst i anførselstegn -


- Vis tekst i anførselstegn -