*1. **Worksheet.Change Event* * *Occurs when cells on the worksheet are changed by the user or by an external link. This event doesn't occur when cells change during a recalculation. Use the Calculate event to trap a sheet recalculation.
This example changes the color of changed cells to blue. Private Sub Worksheet_Change(ByVal Target as Range) Target.Font.ColorIndex = 5 End Sub *2 Worksheet.SelectionChange Event * Occurs when* the selection changes* on a worksheet. e.g You move cell pointer from A1 to A2 The parameter Target is Range("A2") This example scrolls through the workbook window until* the selection is in the upper-left corner of the window*. Private Sub Worksheet_SelectionChange(ByVal Target As Range) With ActiveWindow .ScrollRow = Target.Row .ScrollColumn = Target.Column End With End Sub CMIIW On Fri, Jul 15, 2011 at 6:45 PM, neil johnson <neil.jh...@googlemail.com> wrote: > > Hi Sir, > Can you please tell me what is difference between these two codes, Please guide me. > > Private Sub Worksheet_Change(ByVal Target As Range) > End Sub > > Private Sub Worksheet_SelectionChange(ByVal Target As Range) > End Sub -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel