Collect data from 2 sheet by conditions

14 views
Skip to first unread message

Dániel Szegedi

unread,
Dec 1, 2022, 8:04:50 AM12/1/22
to Google Apps Script Community
Hi guys,

I have 3 table, 2 of them are including schedule for the monthes in weeks.
Sometimes the tables are full, sometimes its not.

I would like to make the 3rd sheet to include the data of #1 and #2, by weeks.

I made an example in #3 that can show what I would like.

Thank you, if you can help me!


#2

#3

Michael O'Shaughnessy

unread,
Dec 8, 2022, 7:50:43 PM12/8/22
to google-apps-sc...@googlegroups.com
Hmmmm.... My first question is "Why do you have 2 sheets?  Can't everything go on one sheet?"

Also, the way the sheet is set up is not conducive to what you want to do.  There would be a lot of repetitive code that would break as soon as someone adds a column or deletes a row. It would be MUCH better if all the data was in ONE row.  You could create a form to make sure you enter all the info correctly.  This will then be much easier to process.  You could then filter and sort and even create nice web page tables to show the data...

BUT, if you have to have them the way they are, this is the process you could follow:
On the 3rd sheet create a script that will read the data from the other 2 sheets using the range B8:V22 on the Jan tab.  You would then combine these 2 arrays, filter out all the "blank lines" (if you want) and then paste the new values into the correct range on sheet 3. You would need to do this 5 times for each range on the Jan tab.  Then you would have the code move to the Feb tab and do the same thing and so on...

So, could it be done, yes, would it be difficult, most likely.  

--
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/93cb4f32-0112-4446-a89f-ad54def2534en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages