Add A Row - Not adding a row to bottom when previous rows are hidden - google-sheets-api

I have an order form (hosted by Jotform.com) that's connected to a Google Sheet via the API through a company called Integromat.com. Everything has worked great for years but I received an email from Integromat.com on Friday that we were using a legacy version of the Google Sheets module and we needed to update before that legacy version stopped working.
I updated our modules (which I assume just updates the Google Sheets API?) and now I'm encountering a problem that I'm not sure how to fix. Integromat is claiming that "Unfortunately this behavior comes directly from Google Sheet's and we can't avoid it." but I question that.
My problem: The sheet that receives the order form data is updated properly so long as the very last row of filled data is unhidden. But we hide rows as orders are completed and if all the rows are hidden and a new order comes in a row is added at the top of the Sheet (row 2 since we have a header that's never hidden in row 1) which in turn throws off several other Sheets that are connected to the order sheet.
Before the update, the add a row function didn't care if rows were hidden or not. But since the update it's like it can't tell if data is contained in hidden rows or not and just proceeds to insert a new row at the top.
Is Integromat correct that this is now unavoidable? Or is there a solution that I can implement or tell them to implement?
The workaround for now will be that we don't hide orders in that sheet but that's not a great long-term solution for us.

The problem can be caused by the first cell of the caption. It seems like integromat (aka make) can't handle it and thinks there is no caption. Then it just adds the new entry as the first line. Once the very first cell in the title contains data, it should work again.

Related

Need script to automate process

We keep our orders & production in Excel. An order workbook looks something like this:
Main Order XXXX
Cabinet
Solid Surface
Diewall
Custom
Metal
Finishing
Moulding
Adaptable
On our Main Order tab, we have a table with all the items on the order. What I need, is a way to automate copying certain rows to certain sheets. We have column on the Main Order that can be used to state which sheet that row needs to go to. Also worth noting, we sometimes have to ADD new sheets if we need more items that need to go on 2 separate Custom tabs for example (but this could apply to any of the sheet names other than Main Order). We do that by copying the applicable sheet and renaming it 'Custom1', 'Custom2'. It's the same format for each sheet - a number after the name of the sheet, no space. Right now, we are doing this all manually and it's very time consuming. Would it be possible to make the script create the new sheet based on what is in the Main Order? Meaning, if we put 'Custom1' in the Main Order table, can the script create the sheet called 'Custom1', copying the 'Custom' sheet and then adding the rows from the Main Order?
I'm not sure if it matters, but the Main Order sheet table starts at Row 18 and is variable in length depending on the order. There's another table below that, but that doesn't need to be copied anywhere. The tables where that rows need to be copied on the other sheets all start at Row 13 (that's the header row) and we can add however many columns we need.
I will admit I'm very new to scripts and VBA, but I have a very basic understanding (I think anyway). I feel like what I'm looking for should be possible, I just don't know enough to figure it out on my own at this point.
I found a script that copies rows to a table, but I need it to be more dynamic. I don't want to have to create a script for each sheet, especially since new sheets can be created as stated above. Below is the script I already have, and I confirmed it worked for the 1 sheet ('Adaptable'). I'm hoping someone can help me make this more 'generic' if that makes sense? So in our Main Order, I want to be able to put in a column the sheet name that the row needs to be copied to and then have it automatically copied, or if the user needs to click 'Run Script' or whatever, that would still be much easier and faster than what we're currently doing.

Excel - Automatically Generate Reverse Sheet

Am trying to automate a workflow . Basically its a Bus schedule timetable .
Say , I have a worksheet with multiple columns And a Set Formula to calculate Reach Time Between Various Stops .
I want to calculate another sheet with the Return Journey Timings .
Source Sheet :
Automatically Generate Reverse Sheet with Modified Formula:
The New Reverse Sheet Should Copy the columns in the Reverse Order . And modify the original formula using the time.
Target :
Create a Sheet where I enter a start Time , the other times should be automatically populated . I have the start times for the sources
Idea is - once I populate One way route with a formula , create a new sheet with return journey details and give an option to enter start time from the return source .
Could this be done in Excel Macros or any faster approach ?
Tried the excel record option but that takes the hard coded column names. Its not dynamic as to if i have a new route with different number of stops , i want it to generate the reverse order sheet based on original
Appreciate some help . Thanks !
I have not tested in Excel, but this uses functions that are shared between Sheets and Excel, so this should work. You can jazz this up to use sheet references, but I kept it simple.
Assume your forward schedule sits in rows 10 and 11, starting in column A. In A13 enter (columns matching matters here)=iferror(offset($A10,0,counta(10:10)-COLUMN()),"") dragging it right as far as you can imagine stops going as well as down one row (for cosmetics you will hide this row (14 in mine) later). Then one row down from that you can enter (and mess around with) whatever time you want in the first column. In column B next to it, place =A15+A14-B14, dragging that right as far as the last stop. These times will be right and will adjust as you change the contents of the first column or the rows on which things are based. You will get nonsense if you drag things further right. (probably there is a way to fix that)

How do I prevent unlocked cells from being selected/editable? (VBA)

I have a very specific question that I am looking for help in answering. I have been researching for hours and I feel like I am not able to find what I am looking for. Below is a quick overview of the criteria that my document must follow:
I am using Excel 2013
I will just be using rows for data input (instead of an excel object
table).
The very top/first row will act as my "column header".
This top row will have AutoFilter enabled.
THE DOCUMENT MUST BE PROTECTED (a must-have)!
I will be using VBA code
Now, the final issue I am having with finishing this document are the last two criteria points that I must have:
The first/top row (column headers) must NOT BE EDITABLE.
Each column must be able to SORT AND FILTER.
Now, in a perfect world, I would just "Lock Cells" for the entire first row that acts as my column headers and when I protect the worksheet I would make sure to check the "Sort" and "Use AutoFilter" boxes.
However, this option does not work because there seems to be an issue when I try to sort the data. If I just filter the data there is no problem, but when I try to sort a column in ascending/descending order I will get an error informing me that I can't sort locked cells while in Protected mode. This is because when excel uses the Sort function, it counts the header as part of the data that is being sorted (I found this out through my research) even though I really just want the data below it to be sorted.
I have been trying to brainstorm on how to get past this issue as well as researching different methods, and I am having trouble coming to a final conclusion. However I have narrowed it down to 2 possible solutions:
I want to be able to keep the cells in the first row officially unlocked to allow the AutoFilter's sort command to work as intended, but make it "behave" like the cells are locked when a user tries to make changes to it (AKA, make the entire row un-editable or un-selectable).
The other option would be to keep the first row locked but somehow have an event in VBA that can tell when a user tries to "Sort" the column, which will then temporarily unprotect the worksheet, follow through with the intended sort command, then protect the worksheet again (apparently though, upon my research there is no such event that can trigger off the AutoFilter's sort command alone).
These 2 solutions are the most logical I can think of based off my research, but if someone out there is an Excel genius and knows another way I am open to suggestions.
Thanks in advance for your help/suggestions,
Travo
Consider using two header rows. The top row would be protected and the second row would facilitate filtering and sorting of the data in rows 3 and below.

Splitting data between worksheets depending on status of Column A

I have been asked to create a database of volunteers in Excel. The main worksheet (called Data) holds all the information – names, addresses, numbers, reference checks, placements, supervisors, etc. What I am trying to achieve is for the relevant information to be moved from one worksheet to another when the status of the person changes.
There would be 5 categories which the volunteers would fall under (column A labelled ‘Status’)
PROCESSING
ACTIVE
ON HOLD
BARRED
STOPPED/RETIRED
What I want to get is a live database so the information would appear on a relevant worksheet whenever the status on the main spreadsheet changes , but I only want some information to show depending on the category…
Each Worksheet would contain columns A-F from the ‘Data’ worksheet and in addition:
Processing would contain columns X-AE
Active: AF-AW
On Hold: AZ-BC
Barred: AX-AY
Stopped/Retired:- BD-BH
I have searched and searched again but I know nothing about Macros (and my IT department is unable to help) So my question is – is this doable and if so is anyone able to help me?
I hope I am making sense and if not I can email across the dummy database with some made up names to show what it is I am trying to create
You can do this using array formulae. This link shows a simple example which provides the basic formula (explained in detail in the linked article)
=INDEX(range,SMALL(IF(col=value,ROW(range)),ROW(1:1)),COLUMN(A2))
Where range is the range of all your data from your main worksheet and value is the value you want to screen for (this changes for each of your sheets) and col is the column on your main sheet that you want to check the values of. Note it is an array forumla so you have to press control+shift+enter after typing in the formula as explained at the bottom of the link.
You will notice that I have changed the formula to say COLUMN(A2) instead of 2. This is so that you can drag the formula across the columns as well as down the rows. You might need to make this COLUMN(A2)-x where x is an offset because your data don't start in column A.
Note that the same applies for the ROW(1:1) part, if your range doesn't start in row 1 then you will need to offset this by some value as well (i.e. something like ROW(1:1)-y)

VBA to transfer a figure from one sheet to another based on matching values other col

I am working on a spreadsheet which is being used to transfer a product from one location to another. Each day I will have a new list of products that needs sending to another location and I already have a "pre-populated" sheet that has suitable locations listed for where these products can be sent to.
I've already worked out the formula's to use which defines the location these products can be sent to (through index and match formula) but once this has been completed, I'd like to update the "pre-populated" sheet with the quantity I'm sending these locations so that limits can be deducted accordingly.
Essentially, I want to copy the figure from column G in ("Task") into column I in ("interstore transfer") where the two "REF" columns in either sheet match. The "New Limit" column will then automatically populate with the new limit based on the figure input into Column I. Once its finished working its way down the list in the sheet ("Task") then end.
I've had a rough attempt at this, but I'm coming stuck with defining the appropriate variables and how it should update.
Any ideas to better my approach would be appreciated.
A VBA solution with variables may not be your best approach for this. Variables declared within VBA code usually have a limited lifetime based on their scope, so when the code ends the values in the variable will be lost.
Another alternative may be to set aside another cell as a counter. Perhaps a good place for this would be next to the "New Limit" column?
Cell values are retained even when VBA code isn't running. Of course cell values also are saved when the workbook saves, so when you get a new list of products at the beginning of the day you can compare to or edit the previous day's work.
To get started with this, I'd recommend getting familiar with how to reference cells and ranges. And, there is some useful information here on Stack Overflow on how to reference well in Excel VBA.