Transferring data from one excel sheet to another - excel

I will preface this by saying I have not much experience with excel.
I'm looking to see if there is a way to input data into one sheet and simultaneously transfer the data to different cells in another. The sheets are not formatted the same. The sheets are used for tracking shipment data. Sheet 1 is for a shipping manifest of contents and the second is used as a master tracker to tell what items were shipped when, quantities, truck #, location # etc.
Is this possible given they're of different formatting?

Related

Comparing data between two sheets in Powershell - how to find data after cells with specific values?

To start, unfortunately I cannot use Import-Excel (yet! organization is looking to implement the module "soon") or other outside modules, so am just working with excel objects manually.
I made an automated report that appends to an excel document every day. It looks something like the included picture. The servers and their data are not in the same cell position for each daily sheet, but are always grouped together (so Server1 and its data might be in the middle of today's sheet, but at the beginning yesterdays sheet). Databases can change, so I'll also be looking into error checking that a database actually exists on both sheets to compare them.
I want to check the most recent sheet (sheet labeled 2020-08-10) and compare each database with the same databases on the oldest sheet (sheet labeled 2020-08-08) to get a size % difference between each database, but I can't seem to figure out how to automate finding the multiple "Database" rows of each server, then going down and grabbing each database and size to compare.
Any help or guidance to get me researching in the right direction is appreciated.

How to match two cells of data on different sheets and then pull a specific cell back to another sheet

I've created a multi-sheet workbook that has Manifest Data (Sheet1), Sammy (Sheet2), Trev (sheet3), Scan Data In (Sheet4). On each of the worksheets is a column labeled Connote and the data within cells of the column relates to a barcode on the paperwork we use. When I open a drivers worksheet i will scan the barcode from the paperwork and information will be pulled from the Manifest Sheet as well Time/Date Stamping using VBA. But what I'm trying to do is pull the drivers name which is in a cell on their worksheet back to the Manifest Data sheet which relates to the connote they have just scanned. I'm happy to upload the working sheet if required. Manifest Data Sheet Drivers Sheet https://1drv.ms/x/s!AiXQNwMzQ3OrnCxn4D54gpnBH9V0?e=fxsTnz
QUICK & DIRECT but limited (update)
Include following function in Manifest under the driver column (assuming driver names are Sammy, Jose, Ian, Tame, etc.):
=IF(NOT(ISERROR(MATCH(A2,Sammy!A:A,0))),"Sammy", IF(NOT(ISERROR(MATCH(A2,Jose!A:A,0))),"Jose", IF(NOT(ISERROR(MATCH(A2,Ian!A:A,0))),"Ian", IF(NOT(ISERROR(MATCH(A2,Trev!A:A,0))),"Trev", IF(NOT(ISERROR(MATCH(A2,Iwi!A:A,0))),"Iwi","no match as yet")))))
Voila!
If there's a match, it will show, else it will show "not match as yet" (you should be able to customize this message fairly easily, even as novice! :)
But if you get stuck with anything else, let me know. Will sort pronto. Just trying to make new joiners feel as welcome as possible Mr Stackoverflow editor! :)
Limitation:
There is a limitation on the number of nested 'if' statements you can have, but this is far quicker than creating additional lookups per tab, then creating a single list based upon FilterXML, then doing a lookup to that list (per below). However, if you anticipate having scores of drivers (as in plenty of them), then below would work out better than above.
There are 2 further options I can advise upon:
Harness VB - given your code / workbooks are already 'VB' 'friendly' (as you've mentioned)
Maintain a central table that contains all of the drivers, and even the associated Manifest data if you really want.
FILTERXML (harder/longer to implement/build, but robust and durable)
Create an additional column in each of your driver sheets (say, in column K for argument sake), that contains the driver name & "-" & Barcode (where barcode exists). E.g.:
=IF(A5="","",$C$2&"-"&A5)
where A5 = Barcode, $C$2 = Driver name
Insert extra sheet and create a FilterXML to combine all of these columns into a single list (in this example, I only take first 42 rows for each of the driver-name sheet (ignore funky strikethrough - this is stackoverflow's doing not mine - screenshot attests):
=FILTERXML(
""&TEXTJOIN("",TRUE,Sammy!$K$5:$K$42)&
""&TEXTJOIN("",TRUE,Jose!$K$5:$K$42)&
""&TEXTJOIN("",TRUE,Ian!$K$5:$K$42)&
""&TEXTJOIN("",TRUE,Tame!$K$5:$K$42)&
""&TEXTJOIN("",TRUE,Trev!$K$5:$K$42)&
""&TEXTJOIN("",TRUE,Iwi!$K$4:$K$42)&
"","//s[not(preceding::*=.)]")
Finally, in your Manifest sheet, you can do a lookup from the Connote (Barcode, right?) to the single Filter-XML sheet/list. A bit of cleaning with mid function to extract just the name and not the 'Barcode-Name' lookup value from step 1 gives something like this in the Driver field of the Manifest sheet:
=IFERROR(MID(INDEX(FilterXML!B2#,MATCH(""&A35&"",FilterXML!B2#,0)),1,SEARCH("-",INDEX(FilterXML!B2#,MATCH(""&A35&"",FilterXML!B2#,0)))-1),"")

Recording data from one excel sheet to another automatically, but keeping even if deleted from master sheet

I have an excel spreadsheet I use to keep track of candidates I'm hiring at work.
This spreadsheet is becoming very large so what I want to do is have 2 sheets:
1) current candidates (candidates who are currently in the process)
2) historic candidates (candidates who are currently in the process and candidates who have previously been in the process).
I could manually add to both sheets, but what I'd like to do is manually update only the current candidates sheet, have the historic candidates sheet automatically update with that data, but when I delete data from the current candidates sheet I want it to remain in the historic candidates sheet.
It's the retaining data in historic candidates I'm having most difficulty in finding a solution to.
You're going to need a macro to do this. It's the only realistic method to actually copy data between different locations, rather than just linking the values.
The good news is that a macro that does this automatically as you enter data in the "Current" sheet would not be difficult to create, and there are many free guides available to walk you through the process.
If you don't want to go the macro route, the alternative would be to work backwards - put all of the data into a single sheet (the "Historical Candidates" sheet), with a flag you can change to mark whether they're a current candidate or not, then use any of the various tools available to filter data to pull a list of current candidates over to another sheet.

Spreadsheet design

I'm designing a file which will calculate a set of certain numbers for each account. Each account has at the moment 5,000 buckets (rows) and 20 selectable criteria (columns). I the future both will grow. I have now 70 accounts, hence use 70 sheets with identical calculation, but the number of accounts will also increase in the future.
Now, this design is terrible, i had to go and change the formula in all 70 sheets. Is there another way of designing the workbook? The rows and columns headings will always be identical for all accounts, but the number of rows and columns may change as well as the number of accounts. I researched the topic and there are lots of guidelines as to how not to design. Well I need a recipe of how to do it. Can someone please advise? PS I can do basic/mid level vba.
Initially, I would recommend writing a macro that would produce the current "template" (ie, column headers and formulas), and running that on any new sheet for new account creation. Then, when the data model changes and you need to change columns/formulas, you can change the template creation macro to match the new model and do a quick:
For Each sht in ThisWorkbook.Worksheets
CreateTemplate(sht)
Next
to change all the existing sheets.
If you structure the sheets so that doing that doesn't mess with your source data, you can keep them all tidy without a lot of work.

conditional copying in excel

hi
i need some help with vba.
i know that when you want to copy excel cells based on a condition, you do so by right clicking the sheet and entering the visual basic screen.
thing is, i'm not very familiarized with vb. i've read some similar posts but haven't been able to understand them completely.
this is what i want to do:
i'm making a workbook for chemistry students to illustrate surface tension. what i did was give them 5 different substances to choose from.
i already have data from reliable sources, so calculations are not a problem.
thing is, i want to display the results on graphs. i only want them to choose 2 different substances at a time, so i only want to display 2 graphs.
i don't know how to copy the data from the substances they chose.
thanks!
I can help you; you need to be more specific. If I understand your question, you have a graph that plots data from one sheet (sheet A), another sheet that contains all the data (sheet B), and you want sheet A to contain some of the data from sheet B, based on a condition specified in sheet A (ie, type of substance) and reload the data in sheet A with some data from sheet B based on an event that triggers the moving of the data. Is this about right? If so, I need to know the following.
1) where is the data stored in sheet A to generate the graph
2) is the data the same lenght (ie. all 5 substance data contain 50 rows, for example)
3) what's the trigger to change graph and start the procedure to move data around
4) how is the data stored in sheet B
5) what is the condition
6) what's the trigger
It'd be nice if you could post your spreadsheet online somewhere.

Resources