+ Reply to Thread
Results 1 to 2 of 2

How to run Multiple onEdit Functions from a single function

  1. #1
    Registered User
    Join Date
    02-18-2023
    Location
    Oklahoma
    MS-Off Ver
    googlesheets
    Posts
    15

    How to run Multiple onEdit Functions from a single function

    https://docs.google.com/spreadsheets...it?usp=sharing



    I am unsure of performance impact but it seems fine for now.

    Any ideas to improve this would be greatly appreciated.

    This single function call has over 30 onEdit changes using different cells

    show and hide rows

    checkbox to set back ground color

    single check box to check multiple checkbox values

    This is a code snippet if anyone has any ideas to improve this please let me know

    Please Login or Register  to view this content.
    Last edited by kwd53; 07-25-2023 at 12:39 AM.

  2. #2
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Multiple onEdit Functions from a single function

    if each onEdit function is for separate tasks, it may be viable to ake separate functions for them, and list them all within a single onEdit, like this:
    function onEdit(e) {
    function1()
    function2()
    function3()
    }

    However it may also be suitable to set if clauses that would have effect depending on the edit made, like this:

    function onEdit(e){
    if (this=== something){
    //do this
    } else if (this=== something else){
    // do this instead
    }
    }

    and then it is also possible to call each operation regardless, like this:

    function onEdit(e){
    //do this
    //do this too
    }

    So you can see that it depends on the need and there may not be just 1 method as it depends what you are really trying to achieve as an overall.

    I wont be copy pasting your code into a file of my own so that i can give free script analysis. Instead, you can go here and create a sample file in which we can check the working code on a working sample data set:
    https://docs.google.com/forms/d/e/1F...VbWiA/viewform
    As a gesture off appreciation, you can click * Add Reputation at the foot of any of the posts of members who helped you reach a solution.

    And finally, was your problem solved? if so, please click Thread Tools above the first post of your enquiry, then select [Solved]

+ 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. Function onEdit advice
    By kwd53 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 02-22-2023, 05:37 AM
  2. Function onEdit advice
    By kwd53 in forum Excel General
    Replies: 0
    Last Post: 02-18-2023, 01:36 AM
  3. [SOLVED] Exclude a specific sheet on onEdit function [Google Apps Script]
    By bhenlee in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 6
    Last Post: 02-14-2023, 09:04 PM
  4. Exclude a specific sheet on onEdit function
    By bhenlee in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 02-09-2023, 11:21 PM
  5. Control multiple functions with single IF
    By AndyGW in forum Excel General
    Replies: 9
    Last Post: 05-08-2017, 10:57 AM
  6. [SOLVED] Multiple functions from single cell
    By Nick1966 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-15-2014, 07:31 AM
  7. Is it possible to use multiple IF functions within a single cell?
    By Jilian in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-22-2013, 12:25 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