"Automatically cut row range to another tab and delete, based off of data validation."

48 views
Skip to first unread message

Ryan Weaver

unread,
Sep 29, 2022, 10:07:21 AM9/29/22
to Google Apps Script Community
I am working on my stock sheet for our company. What I would like to do is when a range in the MO# column is invalid on the data validation (has the red corner) I want that selection which would be the column A-H to be copy and pasted into the past checkouts tab at the bottom of the list, then then those empty cells to be deleted and shifted up, automatically. I do not even know if appscript can detect data invalidation, if it can't is there an other way around it?

Nikola Grujičić

unread,
Sep 29, 2022, 10:24:41 AM9/29/22
to google-apps-sc...@googlegroups.com
How often do you need this kind of a cleaning to be done? 
Maybe the time trigger (set for once a day execution) 
with validation done by the script itself (if you are not sure the script will catch non valid fields) 
and appropriate transfer of data from one tab into another 
can do the job...

On Thu, Sep 29, 2022 at 4:07 PM Ryan Weaver <weaver...@gmail.com> wrote:
I am working on my stock sheet for our company. What I would like to do is when a range in the MO# column is invalid on the data validation (has the red corner) I want that selection which would be the column A-H to be copy and pasted into the past checkouts tab at the bottom of the list, then then those empty cells to be deleted and shifted up, automatically. I do not even know if appscript can detect data invalidation, if it can't is there an other way around it?

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/da5e146f-89e7-4693-989f-10f90b68997dn%40googlegroups.com.

Keith Andersen

unread,
Sep 29, 2022, 10:26:52 AM9/29/22
to google-apps-sc...@googlegroups.com
Ryan,
Yes, it can be done. I will work on this this afternoon hopefully get back to you by tomorrow. 
Cheers,
Keith

Dhanvir Singh

unread,
Sep 30, 2022, 5:01:56 AM9/30/22
to google-apps-sc...@googlegroups.com

On Thu, Sep 29, 2022 at 7:37 PM Ryan Weaver <weaver...@gmail.com> wrote:
I am working on my stock sheet for our company. What I would like to do is when a range in the MO# column is invalid on the data validation (has the red corner) I want that selection which would be the column A-H to be copy and pasted into the past checkouts tab at the bottom of the list, then then those empty cells to be deleted and shifted up, automatically. I do not even know if appscript can detect data invalidation, if it can't is there an other way around it?

--

Ryan Weaver

unread,
Sep 30, 2022, 9:01:29 AM9/30/22
to google-apps-sc...@googlegroups.com
I cannot tell without editor access can you please add me on it.

You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/evyqEk_9WSY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/CANNd6G85gx4OzShHbwrZZm5m12NBKp5NFWp9dfC0nM1wsY_VrQ%40mail.gmail.com.


--
Thank you,
Ryan Weaver
American Flooring Dewitt
13151 Schavey Rd 

Dhanvir Singh

unread,
Oct 1, 2022, 1:51:24 AM10/1/22
to google-apps-sc...@googlegroups.com

Ryan Weaver

unread,
Oct 1, 2022, 10:13:39 AM10/1/22
to google-apps-sc...@googlegroups.com

Keith Andersen

unread,
Oct 1, 2022, 1:38:35 PM10/1/22
to google-apps-sc...@googlegroups.com
Ryan,
Been experimenting with this for a few days now. Yes- it is technically it is possible as I stated before but unfortunately the delete-cells and move data upward is server intensive. I wind up having to put a pause on the script at the beginning of the loop of 3 seconds in order for it to both remove the data after it copies the data in that row to an array. 

That being said... I'm searching for a better solution.

Keith

Ryan Weaver

unread,
Oct 1, 2022, 1:40:42 PM10/1/22
to google-apps-sc...@googlegroups.com
Thank you so much it could be time triggered instead like daily if that is better.

Keith Andersen

unread,
Oct 1, 2022, 1:59:23 PM10/1/22
to google-apps-sc...@googlegroups.com
Time trigger won't help it's the overall process of looping through and removing with the specificity of only taking the data and then moving the rows upward.

I'm going to try just deleting the entire row. That would mean that you would have to add one more sheet as a helper sheet with your drop-down validation and or other lists on that page.

I will work on that today and let you know.
Keith 

Ryan Weaver

unread,
Oct 1, 2022, 2:00:08 PM10/1/22
to google-apps-sc...@googlegroups.com

Dhanvir Singh

unread,
Oct 3, 2022, 12:56:16 AM10/3/22
to google-apps-sc...@googlegroups.com
it's just a formula based not have any trigger...


Dhanvir Singh

unread,
Oct 3, 2022, 12:59:41 AM10/3/22
to google-apps-sc...@googlegroups.com
its update automatically when any new entry entered

Reply all
Reply to author
Forward
0 new messages