+ Reply to Thread
Results 1 to 3 of 3

multiple Sub Worksheet_Change(ByVal Target As Range)

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    77

    multiple Sub Worksheet_Change(ByVal Target As Range)

    Hi
    how do I combine the following two codes please? The 1st part works but cannot get it to display date for the second column.

    Private Sub Worksheet_Change(ByVal Target As Range)
    With Target

    If .Cells.Count > 1 Then Exit Sub
    If Intersect(.Cells, Me.Range("C:C")) Is Nothing Then Exit Sub
    .Offset(0, -2).Value = Now

    If Intersect(.Cells, Me.Range("L:L")) Is Nothing Then Exit Sub
    .Offset(0, 2).Value = Now

    End With

    End Sub


    Any help would be greatly appreciated.

    Many Thanks
    Hoss

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: multiple Sub Worksheet_Change(ByVal Target As Range)

    Don't use Exit Sub on the Intersect test if you want the code to proceed.

    Try using:

    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    11-13-2012
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: multiple Sub Worksheet_Change(ByVal Target As Range)

    Dear romperstomper

    Thank you so much - works perfect

    Hoss

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Combining multiple Private Sub Worksheet_Change(ByVal Target As Range)
    By victortan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-21-2014, 11:12 AM
  2. [SOLVED] Worksheet_Change(ByVal Target As Range) - set to only update when 3 target cells changed?
    By trillium in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2012, 06:40 PM
  3. Worksheet_CHange (ByVal Target as Range) when target is formula cell
    By coasterman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2012, 07:00 PM
  4. use of Worksheet_Change(ByVal Target As Range)
    By Isaac in forum Excel General
    Replies: 2
    Last Post: 07-07-2006, 02:10 PM
  5. [SOLVED] Worksheet_Change(ByVal Target As Excel.Range)
    By Daggi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2005, 10:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1