+ Reply to Thread
Results 1 to 4 of 4

two different scenarios in a worksheet change

  1. #1
    Registered User
    Join Date
    09-18-2015
    Location
    Milwaukee
    MS-Off Ver
    2007
    Posts
    15

    two different scenarios in a worksheet change

    I'm way over my head on this project today!! My VBA knowledge is spotty.

    I've disabled auto calculation on my worksheet and want to perform certain calculations only when specific data changes. My two scenarios seem to conflict.

    Please Login or Register  to view this content.
    What I want it to do, is when J5 changes, recalculate all the specified cells. OR, if any value in F4:F58 changes, recalculate just some of the cells

    With the code the way I have it, when I change the value of J5, I get "run-time error 13 Type Mismatch" and it highlights [if target <> "" Then] in that second clause.

    I'm assuming it's because J5 does not intersect with F4:F58 but I'm stuck on how to rewrite this to get it to work.

    EDIT: Alternatively, I guess my real problem is I only want E4:E58 to recalculate when J5 changes and no other time.
    Last edited by devi1337; 03-29-2017 at 04:01 PM.

  2. #2
    Forum Contributor
    Join Date
    02-20-2017
    Location
    Indiana
    MS-Off Ver
    2016
    Posts
    101

    Re: two different scenarios in a worksheet change

    Try this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-18-2015
    Location
    Milwaukee
    MS-Off Ver
    2007
    Posts
    15

    Re: two different scenarios in a worksheet change

    That seems to have done the trick!

    Am I understanding this right, basically you're telling it "should this procedure cause an error, just skip the procedure" ??

  4. #4
    Forum Contributor
    Join Date
    02-20-2017
    Location
    Indiana
    MS-Off Ver
    2016
    Posts
    101

    Re: two different scenarios in a worksheet change

    Yeah, basically

+ 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] Help with Worksheet Change command to change Cell value without pressing Enter key
    By rv02 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2016, 12:30 PM
  2. using a cell to change scenarios
    By elmasguapo in forum Excel General
    Replies: 4
    Last Post: 10-28-2015, 04:10 PM
  3. [SOLVED] How to prevent worksheet change invoking System X Control change event
    By dmw2014 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-13-2014, 10:35 PM
  4. Change this VBA code from Worksheet Change to Worksheet calculate?
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2013, 04:26 AM
  5. Replies: 5
    Last Post: 02-01-2013, 12:58 PM
  6. auto change cell formula on condition of worksheet change in other cells
    By futurejock in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-01-2009, 12:11 AM
  7. Cell value change to trigger macro (worksheet change event?)
    By Neil Goldwasser in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2006, 10:00 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