Automate the creation of a new row - google-sheets-api

I have tried Automate.io, and it works well with google sheets.
But have one problem.
What I want to do is:
When a new row is added on spreadsheet 1, the bot should add a new row in spreadsheet 2. But I also want it to choose a worksheet on spreadsheet 2 depending on a value.
Is that possible to do?

Related

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

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.

Copying multiple results based on a drop-down list

I'm pretty new to creating Macros in Excel and using VBA.
Let's say I have a model based on a drop-down list. Based on the item selected from that list, model analyses according data and creates results. My point is to have these results compared for all the components from the list, in another sheet. The problem is that list includes around 200 item numbers.
What I need my macro to do is:
Choose the item number from the drop-down list in cell A1 in the "Sheet1"
Copy the range A1:E2 in the "Sheet1"
Paste the results to the Range A1:E1 in "Sheet2"
Go back to "Sheet1" and choose next item from the list
Copy the same range
Paste it to "Sheet2" one row below the previous one (creating a list)
And repeat the action until the last item on the list is used.
Does anybody have any advises how to write this macro down?
The task is by far exceeding my current programming skills. I searched everywhere, but couldn't find anything what would guide me into solution.
I implemented what you want on an Excel workbook with two sheets. Download it here:
http://s000.tinyupload.com/?file_id=05985444391023940738
Try this. Does it do what you need?

Copy Range of Multiple Colums and post into another worksheet within same document in VBA script

What Im trying to to is take information from row C,D,E,F,F,AL,AM from Sheet Add all the at information starts on Row 3 and put it into Sheet Final Data and start on Row 3.
Is there a way to write a VBA script for it?

Creating a Macro in VBA out of four Excel formulas

I am working on ways to improve an Excel file that is updated throughout the day on an hourly basis. Currently I have the worksheet set up with four index Match formulas to auto populate some of the data that is entered every time one specific value is entered in column 2(B).
Recently my team has had to share this data with another team by giving them permissions to the file. This team is not a reporting team so they have this bad habit of editing cells with formulas and making things not work properly.
I was wondering if anyone would be able to help me out with trying to come up with a MACRO that could integrate these formulas in the same order so that the formulas need not be directly on the workbook and possibly edited over.
I am newer To macros and have not built one like this as of yet.
The formulas are set as the following with the name of the sheet being matched to Sheet2:
=IFERROR(IF(LEFT(C394,2)="19",INDEX(Sheet2!A:T,MATCH(C394,Sheet2!D:D,0),1),IF(LEFT(C394,1)="3",INDEX(Sheet2!A:T,MATCH(C394,Sheet2!H:H,0),1),INDEX(Sheet2!A:T,MATCH(C394,Sheet2!J:J,0),1))),"")
=IFERROR(IF(LEFT(C394,2)="19",INDEX(Sheet2!A:T,MATCH(C394,Sheet2!D:D,0),3),IF(LEFT(C394,1)="3",INDEX(Sheet2!A:T,MATCH(C394,Sheet2!H:H,0),3),INDEX(Sheet2!A:T,MATCH(C394,Sheet2!J:J,0),3))),"")
=IFERROR(IF(LEFT(C394,2)="19",INDEX(Sheet2!A:T,MATCH(C394,Sheet2!D:D,0),5),IF(LEFT(C394,1)="3",INDEX(Sheet2!A:T,MATCH(C394,Sheet2!H:H,0),5),INDEX(Sheet2!A:T,MATCH(C394,Sheet2!J:J,0),5))),"")
=IFERROR(IF(LEFT(C394,2)="19",INDEX(Sheet2!A:T,MATCH(C394,Sheet2!D:D,0),6),IF(LEFT(C394,1)="3",INDEX(Sheet2!A:T,MATCH(C394,Sheet2!H:H,0),6),INDEX(Sheet2!A:T,MATCH(C394,Sheet2!J:J,0),6))),"")
The result looks like something similar to this:
9999999 Department 1 SMITH,ROBERT JANE DOE JOHN DOE
9999999 Is the value we enter manually the other four values are populated by the formula.
Write all formulas at once with a one-size-fits-all formula.
range("d394:g394").formula = _
"=IFERROR(INDEX(Sheet2!$A:$F, MATCH($C394, INDEX(Sheet2!$D:$J, 0, 7-(LEFT($C394,2)="19")*6-(LEFT($C394)="3")*2), 0), CHOOSE(COLUMN(A:A), 1, 3, 5, 6)),TEXT(,))"
You should be able to expand that range to include more rows.

VBA script to copy specific rows in Excel from a given workbook to a new workbook if specific value is found in a given column

I have been looking for a solution to my problem for the past 48 hours and I couldn't find anything. Keep in mind I have very basic programming knowledge and I might have overlooked something to fit my needs without understanding the code behind it.
I have an excel workbook with a sheet containing all of the data.
It's a list of shipments going in and out of a port.
Now when something is loaded, a "Date Loaded" cell is populated with the date automatically.
What I need for every row that has a blank "Date Loaded" cell to be copied to a new workbook which will be named by the date it was generated (i.e.:031814-PM) depending on the time of the day, PM could be AM.
Now I might not need all the columns to be copied to the new workbook. I need a way to exclude those columns during the copying process.
I want the VBA script to be called with a button that will be at the top of the data worksheet so that when we click on it, the new workbook is generated.