+ Reply to Thread
Results 1 to 3 of 3

Private Sub Worksheet_Change(ByVal Target As Range)

  1. #1
    Registered User
    Join Date
    08-01-2019
    Location
    Southend-on-Sea, England
    MS-Off Ver
    2010
    Posts
    1

    Private Sub Worksheet_Change(ByVal Target As Range)

    Hi, I have a sports draw spreadsheet that allows the entry of a result and a manual copy of the winner's name into the next round column. This cell change kicks off the Worksheet_Change code which automatically updates my website and sends an email to the winner and next opponent. All works well.
    However I tried to change my manual copy and paste of the winner's name with the following: =IF(AND(J20="",J24=""),"", IF(J20="w/o",I20, IF(J24="w/o",I24, IF(J20>J24,I20, IF(J24>J20,I24, ))))). This works but the winners name landing in the next round cell doesn't kick off the Worksheet_Change code. I need to add that the Worksheet_Change checks for numeric value or blank entered and goes to the end of the Sub.
    Has anyone any suggestions how I can keep my Worksheet_Change AND initiate from the =IF( function?
    Hope this makes sense. If you need to see any code in my Worksheet_Change sub I can provide it, however it is a bit long!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Private Sub Worksheet_Change(ByVal Target As Range)

    Hello PIM499,

    Welcome to the forum!

    Formula calculations do not trigger Worksheet_Change events, only user input and VBA code that changes a cell's value will.

    When you have time, please read the Forums Rules. It will help you get answers to your questions faster.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Private Sub Worksheet_Change(ByVal Target As Range)

    Perhaps you could try something like:

    Please Login or Register  to view this content.
    where B15 contains a formula and the you need a macro to check B15

    Please Login or Register  to view this content.
    Alf

+ 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] Private Sub Worksheet_Change(ByVal Target As Range)
    By TheTallOne in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-28-2018, 11:19 AM
  2. [SOLVED] Private Sub Worksheet_Change(ByVal Target As Range)
    By hmr2662 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2015, 12:35 PM
  3. [SOLVED] Private Sub Worksheet_Change(ByVal Target As Range) End Sub
    By kanonathena in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2013, 12:25 AM
  4. Private Sub Worksheet_Change(ByVal Target As Range) Help
    By adamsj1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-28-2012, 09:17 AM
  5. [SOLVED] Private Sub Worksheet_Change(ByVal Target As Range)
    By Hilton1982 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-18-2012, 01:13 AM
  6. [SOLVED] Private Sub Worksheet_Change(ByVal Target As Range)
    By Arturo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2005, 11:06 AM
  7. Private Sub Worksheet_Change(ByVal Target As Range)
    By bondcrash in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2005, 02:59 PM

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