I'm writing a VB script which should execute every time I update a
cell on a certain sheet. The script should check my value and based on
this change the formatting on the same cell in all other sheet. I got
this working with the following code:

Private Sub Worksheet_Change(ByVal Target As Range)
            For cntr = 4 To Sheets.Count
                With Sheets(cntr).Cells(Target.Row,
Target.Column).Interior
                    .Pattern = xlSolid
                    .PatternColorIndex = xlAutomatic
                    .ThemeColor = xlThemeColorDark1
                    .TintAndShade = -0.149998474074526
                    .PatternTintAndShade = 0
                End With
            Next cntr
end sub

However, this does not work if I change more than one cell at a time,
i.e. it generates an error if a drag a value through several cell or
if I cut and paste into more than one cell.

I assume this has to do with the fact that I am using the cells
properties combined with the target.cell and target.column but how do
I write this using the range routines or any other function.

Regards
Johan Riesbeck

--~--~---------~--~----~------------~-------~--~----~
-------------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
-------------------------------------------------------------------------------------
-~----------~----~----~----~------~----~------~--~---

Reply via email to